Table of contents

Can't connect to Mongo in VM

This is probably happening because your VM didn’t shut down cleanly. You should be running vagrant halt or vagrant suspend but if you had to kill your VM or restart your machine MongoDB won’t be able to connect. You can fix this by deleting your mongod.lock and restarting MongoDB.

$ sudo rm /var/lib/mongodb/mongod.lock
$ sudo service mongodb start
This page was last reviewed on 12 October 2018. It needs to be reviewed again on 12 April 2019 by the page owner #govuk-2ndline .
This page was set to be reviewed before 12 April 2019 by the page owner #govuk-2ndline. This might mean the content is out of date.