1

When I try to run my mongoDB image called database with sudo docker run -p 27017:27017 I get exitCode 100. I looked at some info online and found this about exitCode 100: Returned by mongod when the process throws an uncaught exception. I've had this issue before and was able to fix it with docker system prune --force but when i do it now I get the same exitCode.

I have tried building the image again but when I do that I either get the same exitCode or exitCode 51, of which I can't find any info online.

Any idea how I can fix this?

EDIT: I am working on an Ubuntu server vm and it has worked before.

Content of my Dockerfile:

From mongo:latest

COPY usertoevoegen.js /docker-entrypoint-initdb.d/

RUN mongod --fork  --logpath /var/log/mongodb.log --dbpath /data/db

Content of usertoevoegen.js:

db=db.getSiblingDB('admin');

db.createUser({user: "admin",pwd: "admin123",roles: [{ role: "root", db: "admin" }]});

db.createCollection("gebruiker");

db.gebruiker.insert([{"naam" : "Toon"}]);
Toon Staes
  • 61
  • 1
  • 7
  • Maybe you have `usertoevoegen.js` written in windows with CRLF ? – Max Dec 24 '20 at 14:04
  • I forgot to mention I am using Ubuntu server vm so I don't think that's the case Max. And it has worked yesterday. – Toon Staes Dec 24 '20 at 14:46
  • 1
    Does this happen with specified file only? Did you change anything in the configuration? What happens when you run these steps outside of docker, for example locally or on some VM? – JustLudo Dec 24 '20 at 14:57
  • It indeed is only with this file and i haven't tried outside of docker. But the weird thing is that it has worked before. – Toon Staes Dec 25 '20 at 15:38
  • Check logs of docker container itself. Does it say anything?https://stackoverflow.com/a/38113168/4486909 Also run your container with mount for mongodb log. In this case you'll retrieve the original error. – Olesya Bolobova Dec 25 '20 at 23:25

1 Answers1

5

Apparently I didn't have enough storage left on my server which caused the error.

Toon Staes
  • 61
  • 1
  • 7
  • I read this and clean up my Docker with old images and containers and it worked. Honestly don't know if that was the root cause – tufac2 Mar 23 '22 at 14:26