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
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.
My errror started with an error 62.
2018-06-10T13:49:27.750-0400 I CONTROL [initandlisten] shutting down with code:62
I deleted /db and reinstalled /db in /data/db.
$ sudo -r rm db
Once I did this and tried to run >mongod I got a 100 error. I had to change the rights
2018-06-10T13:52:20.042-0400 I CONTROL [initandlisten] shutting down with code:100
To fix this I did:
$ sudo chown -R `id -un` /data/db
Once this was run I was able to run mongo db.
$mongod
I hope this helps.