Error in mongodb: "getFile (): invalid file number value (damaged db?): Perform repair"

Since my last update to Meteor, my database has been corrupted. First, he started with this error message when I tried to create a new user (we use meteorite accounts):

getFile(): bad file number value (corrupt db?): run repair

Then I saw in another question that I should start db.repairDatabase(), but although the mongo shell reported that the database is now ok, it actually does not work. The error message above appeared.

So, I read something about corrupted indexes and dumped indexes in collections users, and that obviously just made things worse. Now I have two users with the same email address, and Meteor no longer starts:

MongoError: E11000 duplicate key error index: meteor.users.$emails.address_1  dup key: { : "thiago@gdeahj.com" }

When I try to delete one of these users, the original error appears again:

meteor:PRIMARY> db.users.remove({ _id: "cAtu2XsEXTbqL2Wvx"})
getFile(): bad file number value (corrupt db?): run repair`

Fortunately, we are still at the development stage, and we can just drop the entire database and start all over again, but this made me really unsure that you are running Meteor on a production environment. Is there a way to fix the database in this state?

+4
source share
1 answer

db.repairDatabase, , , . , , , , . , . MongoDB.

+2

Source: https://habr.com/ru/post/1568773/


All Articles