Skip to main content
Table of contents

Development VM

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 17 October 2019. It needs to be reviewed again on 17 April 2020 by the page owner #govuk-2ndline .
This page was set to be reviewed before 17 April 2020 by the page owner #govuk-2ndline. This might mean the content is out of date.