Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB - shutting down with code:62

Tags:

mongodb

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

enter image description here

like image 367
Hastalavistababyml Avatar asked Dec 16 '17 21:12

Hastalavistababyml


6 Answers

Delete the data directory where MongoDB stored and create again.

rmdir data 

And:

mkdir data/db 
like image 80
Hastalavistababyml Avatar answered Sep 28 '22 09:09

Hastalavistababyml


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.

like image 27
ZolotovPavel Avatar answered Sep 28 '22 10:09

ZolotovPavel


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
like image 26
Akash Jain Avatar answered Sep 28 '22 08:09

Akash Jain


 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 !!!

like image 37
Jerry Avatar answered Sep 28 '22 08:09

Jerry


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.

like image 23
ImNtReal Avatar answered Sep 28 '22 10:09

ImNtReal


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/

like image 21
Namit Agrawal Avatar answered Sep 28 '22 09:09

Namit Agrawal