Open ffxsam opened 8 years ago
I recently put a PR for Mongo backup and restore. It seems that the Mongo container mounts a volume from /var/lib/mongodb in there is a mongod.lock file that triggers the Mongodb container startup loop. In the PR I made tools to help remove the lock although you're supposed to do a proper manual check/repair on the database if you do that. It's done that way to preserve the database ultimately but it does cause confusion.
Figured it out! It has to do with running more than one application on a server, e.g.:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
af06637addfe meteorhacks/meteord:base "/bin/sh -c 'bash $ME" 9 minutes ago Up 7 minutes 0.0.0.0:3001->80/tcp myapp
267a280d9a12 mongo "/entrypoint.sh mongo" 9 minutes ago Up 7 minutes 127.0.0.1:27017->27017/tcp mongodb
89eeca62be1e meteorhacks/meteord:base "/bin/sh -c 'bash $ME" 20 hours ago Restarting (8) 27 seconds ago 0.0.0.0:3000->80/tcp myapp2
Everything was totally fine when it was just a single Meteor app and the mongodb container. Now that I added a second one, one keeps restarting in a loop with the error above. The only workaround I've found is to run (in this example) mupx setup && mupx deploy
for myapp2 to re-deploy it.
@arunoda Any idea what's causing this? This seems like a serious issue.
@ffxsam : Running into the same issue, curious if you ever found a more permanent fix?
Nope, never got a fix for this. And I imagine Arunoda has his hands full with other stuff (Mantra, moving stuff from Atmosphere to NPM, etc). I suppose the best workaround would be to have a separate Mongo server, and run multiple Meteor apps on another server, setting MONGO_URL
accordingly.
I had a similar error. For me, mongodb
container was not starting and docker logs
revealed that an old lock file was preventing mongo from starting. For my server, I had to remove /var/lib/mongodb/mongod.lock
to get it working again.
My MongoDB Backup and Restore PR https://github.com/arunoda/meteor-up/pull/736 that was never merged (along with many others), addressed that issue. I think "mupx setup" had the same effect but it wipes the database.
We've been having a very serious bug in production, where randomly, the Docker link to mongodb just goes away, causing the container to get stuck in an endless "restarting" loop.
docker logs
shows the following:It seems the Docker link to
mongodb
container breaks for some reason. Why does this keep happening? The only workaround I've found is to remove the container completely and do amupx setup && mupx deploy
to build from scratch.