I followed the MongoDB Docs to run my MongoDB in macOS,
When I start MongoDB using the terminal get this error:
Shutting down with code: 62
Delete the data directory where MongoDB stored and create again.
rmdir data
And:
mkdir data/db
I had a similar problem when I switched to a new version mongod
without upgrading the data (from version 3.2
, for example, to version 3.6
).
In this case, mongod
outputs ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.
(mongod
was started with the --verbose
key).
The link does lead to detailed instructions on how to upgrade the data.
It is strange that error 62
is not described in the documentation.
This has worked for me
Initially i was facing various issues, like when i tried to start the server by using:
mongod
I received this error: shutting down with code 100
and then i tried to start by
sudo mongod
I received this error: shutting down with code 62
finally this command helped me to get rid of various issues
sudo mongod --repair
Now mongod server is running tentatively
sudo mongod
Error code 62:MongoDB dbpath doesn't support the current version
Removing data director is not an optimal
solution. The best solution would be to upgrade to the higher version.
Else take the dump & restore the complete database on a fresh instance with a higher version.
mongodump --db employee --out /path/
mongorestore /path/employee/
Hope this helps !!!
I ran into this issue on Arch Linux. I solved it by installing mongodb34-bin from the AUR (which required removing the mongodb package). Then I ran
$ sudo mongodb --repair
Then, I started the database from the 3.4 binary, and ran
$ mongo
> db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )
{ "ok" : 1 }
> quit
After that, I stopped the 3.4 version, and reinstalled the regular mongodb package, and did a second repair.
Please ensure if you are upgrading MongoDB, your featureCompatibilityVersion version is correct. I faced similar problem, after updating featureCompatibilityVersion to the correct version, it worked fine.
Reference: https://docs.mongodb.com/manual/reference/command/setFeatureCompatibilityVersion/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With