Data loss on Mongodb Atlas Cloud M0 Sandbox without a reason

Hi team, i was encountered a weird situation of losing all data on my collection after initing the data set . I did not run any delete operation on this collection but all data were deleted !!
Is there any way to restore the deleted data on mongo cloud, i used free version with Replica Set - 3 nodes
This is the very important data i need to restore it urgently !!

Hi Macrochain,

I am so sorry to hear that you have lost data. We take situations like this very seriously: in the database business nothing is more important than not losing data and this is simply unacceptable. We have thousands of Free Tier deployments every day and have never heard of anything like this happening before.

Are you confident you loaded data, and then it was gone later? Is it possible it never successfully loaded o begin with, or is it possible you issued a drop database command (or similar)? Unfortunately the Atlas Free Tier does not have backups the way our M2+ clusters do.

It’s very important we get to the bottom of what happened so what we can ensure it doesn’t happen to someone else. Have you opened a support case? that will allow us to more closely track

Very regretfully
-Andrew

1 Like

I just had this same issue, was using Mongoose though.

Model.findOneAndUpdate( { _id: new ObjectId() }, req.body.object, { new: true, upsert: true }, function (err, result) {
    if (err) return res.send(500, { error: err });
    return res.send(result)
});

Any chance you were also using Mongoose or NextJS @Macrochain_Coinlist ? I am now switching some API routes off of Mongoose to see if the deletion still happens.

Opened a support case today and they confirmed no drop commands were issued. Was seeing inserted data live on my Next.js website, only to disappear 6-12 hours later.

Joey this is certainly very concerning to read, were we able to get to the bottom of the problem?

Here the same issue.
I was storing data at my backend (Node.js) using mongoose. I come back to the db to do a export and only 1 collection is available, all the other collections has gone! I was watching very close to the new records in this db until Dec. and was everything ok. Is there a situation with M0 Sandbox (General)? How could I recover these collections?

Hey Erick, unfortunately, unless you have a backup there is no way to recover that data, been down this path before with Mongo and they offered no help but I understand they tried. I ended up rewriting most of my app to use the normal MongoDB drivers. You can get away with keeping Mongoose for reading and $project data but for inserts and updates you gotta use Mongodb, definitely file a ticket with them though, won’t hurt. Out of curiosity were you using Next.js?

We recently had a similar problem on a Serverless instance:

I was happily developing an application that should only write and read data on a database that I had created manually before, and suddenly that database was gone, including all collections and data. (No data loss for me fortunately as it was all test data and I had the JSON export in an editor, so simple and quick to recreate).

Today I figured out what was happening: I was working in a colleague’s codebase, basically messing with the test setup to try some things out. So I put my connection string in there, and then used the app a bit. Everything worked, so I committed this temporary change to a temporary branch on Git. With this commit, I accidentally triggered a CI workflow that somewhere deep in running the tests, makes sure that the database is in a good state: It drops, recreates and seeds it :poop: It did the first part of its job and dropped the database, then failed because it did not have information on what and how to recreate.

I never saw this CI failure. I just saw my database gone while manually clicking around in the app. Ooops.

3 Likes