[SERVER-36905] Database corrupt Created: 28/Aug/18 Updated: 23/Sep/18 Resolved: 30/Aug/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | WiredTiger |
| Affects Version/s: | 3.4.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | it@iidf.ru | Assignee: | Nick Brewer |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Participants: |
| Description |
|
Hello! Our MongoDB base is corrupted by problems with hard drive. We recover our disk with database and MongoDB server We check config and MongoDB database folder. Config ok and have a right dbpath. In dbpath directory we have many files like this: total 2.5G Its looks like a database! Our mongod daemon started and we can enter in it by Robo3t, but we see only admin and local databases. We try to repair it by "mongod --repair --dbpath (path)" key and its nothing gave to as We try "./wt -v -h ../mongo-bak -C "extensions=[./ext/compressors/snappy/.libs/libwiredtiger_snappy.so]" -R salvage collection-2657-1723320556100349955.wt" on all collections in dbpath directory (by WiredTiger utility) and its nothing gave to as again Can you help as with this problem? Thanks! Have a good day! |
| Comments |
| Comment by it@iidf.ru [ 31/Aug/18 ] | |
|
Ok! Thank you for your help, Nick! Have a good day! =) | |
| Comment by Nick Brewer [ 30/Aug/18 ] | |
|
it@iidf.ru This still appears to be a permissions issue - I would suggest ensuring that all of the files within /var/lib/mongodb are owned by the mongodb user and group, and then removing the mongod.lock file, and rebooting the mongod. Since this doesn't demonstrate an underlying bug in MongoDB, I'm going to close this ticket. For MongoDB-related support discussion I suggest posting on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group. -Nick | |
| Comment by it@iidf.ru [ 30/Aug/18 ] | |
|
Hello! When we try to "systemctl start mongod" we get this message: root@db01:~# systemctl start mongod Aug 30 02:50:08 db01 systemd[1]: Started High-performance, schema-free document-oriented database.
In log we get: 2018-08-30T02:53:01.977-0400 I CONTROL [main] ***** SERVER RESTARTED ***** , storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log", verbosity: 1 } }
I see "Permission denied" message, but I check permissions of the dbpath directory, it's ok =( | |
| Comment by Nick Brewer [ 30/Aug/18 ] | |
|
it@iidf.ru Are you starting the mongod in a different way than you normally would? For example, do you usually start mongod via the init system (something like sudo systemctl start mongod or sudo service mongod start), and are you instead starting it manually via mongod --repair --dbpath (path)? If so, I'd like to know what happens when you try starting the mongod as you normally would. Thanks, Nick | |
| Comment by it@iidf.ru [ 29/Aug/18 ] | |
|
Hello! Yes, we make a "chmod I make new logs for you And I can't find the "src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp" directory, where it must been?
| |
| Comment by Nick Brewer [ 28/Aug/18 ] | |
|
it@iidf.ru From the log file you've provided, it appears that you're running into a permissions issue after the repair you attempted:
Have you compared the permissions of the files in your dbpath after the attempt to repair with the wt binary against the permissions of the files in the backup taken last week? -Nick | |
| Comment by it@iidf.ru [ 28/Aug/18 ] | |
|
From the MongoDB shell we see 2 standart databases (admin and local) and a standart collections in it. In sum we see with shell the some thing like a with Robo3T | |
| Comment by it@iidf.ru [ 28/Aug/18 ] | |
|
MongoDB version is 3.4.3 Linux db01 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux Server working at VMvare as virtual machine We have a backup by 1 week ago, we try to put it instead of original database folder and result not change =( We have a WiredTiger.wt and WiredTiger.wt.1, I upload both to this issue Also I upload a log at disk breakdown moment. Thank you for your help! | |
| Comment by Nick Brewer [ 28/Aug/18 ] | |
|
it@iidf.ru Can you include the log entries from the time you start the mongod? Additionally, have you checked what collections are available via the mongo shell directly, as a user with appropriate access? I should note that we don't recommend attempting to recover files via the wt binary directly. If you have any backups available from before the hard drive issue, this would likely be the fastest way to get your database back into a functional state. That said, if you can upload your WiredTiger.wt and WiredTiger.turtle files, I would be happy to attempt a repair; in addition to the requested log entry, I'd need to confirm:
Thanks, |