Mongo: Image mongo:3.4.2 won't start

Created on 29 Mar 2017  路  10Comments  路  Source: docker-library/mongo

Hello,

I'm trying to run the image mongo:3.4.2 but it fails due to permission issues.

For example:

$ docker run --name some-mongo -d mongo
ae758deef0467374507fdb0e3bc0d34f14bef6bd1642077d10f29aa10f5bbd25

$ docker logs some-mongo
chown: cannot dereference '/proc/1/fd/1': Permission denied
chown: cannot dereference '/proc/1/fd/2': Permission denied
about to fork child process, waiting until server is ready for connections.
forked process: 19
ERROR: child process failed, exited with error number 1

Tried with mongo:3.4.1 and worked fine.

Regards, Jorge

Most helpful comment

That log looks like it's started successfully, not failing to start.

All 10 comments

Same here. 3.4.2 (or :latest at this point in time) fails but 3.4.1 is working. In addition 3.0 is failing with the same log output but I'm rather sure it worked before...

Edit: failing on CentOS 7

Unfortunately, same for me. Dropped comment to #158

Weird, it works fine on a Debian server but constantly fails on Ubuntu workstation.

I'm getting this on:
mongo:3.5
mongo:3.4 (3.4.3)
mongo:3.3
mongo:3.2

but not:
mongo:3.1
mongo:3.4.2

(tested on ubuntu 14.04 and 12.04)

Getting same issue with mongo:3.0.14. I fixed it by running it as mongodb user, following advice given by this comment:

docker run --user mongodb -ti mongo:3.0.14

@elouanKeryell-Even that one's not working on me on either 3.0.14 or any of the later ones I listed above.

$ sudo docker run --user mongodb -ti mongo:3.0.14
about to fork child process, waiting until server is ready for connections.
forked process: 11
ERROR: child process failed, exited with error number 1

Is this issue something that should be taken care of on mongodb authors side or is it just the Dockerfile maintainers problem?

@errnoh, this is a bug on the Dockerfile side.

All, we added some fixes in https://github.com/docker-library/mongo/pull/167 to hopefully account for this; can you pull and see if the latest image works for you?

Unfortunately we don't yet have a good way to have the initdb.d/ additions from #145 work with a config file.

You should be able to work around the new additions by setting ENTRYPOINT [] and USER mongodb at the end of your Dockerfile since that is what the previous entrypoint script provided (or docker run --user mongodb --entrypoint mongod mongo:3 --mongod-args). This would require you to ensure any external volumes used are the correct permissions for the mongodb user from the image.

We are trying to fix any bugs caused by adding the initdb.d/ functionality, but have been unable to reproduce and discover the cause.

I'm experiencing the exact same issues with MongoDB 4.0.1

I'm using a Ubuntu 18.04 workstation, however I haven't tried this on a server

example taken from the first comment in this issue

$ docker run --name some-mongo -d mongo
2f8ca82a301720dda86909f9acd3526e03c0fc4719ad454eff17866574ce9522
$ docker logs some-mongo
chown: cannot dereference '/proc/1/fd/1': Permission denied
chown: cannot dereference '/proc/1/fd/2': Permission denied
2018-11-15T21:30:43.908+0000 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2018-11-15T21:30:43.934+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=2f8ca82a3017
2018-11-15T21:30:43.934+0000 I CONTROL  [initandlisten] db version v4.0.1

any suggestions how to fix this issue?

That log looks like it's started successfully, not failing to start.

ok, my mistake

I tried to connect to MongoDB and had another issue which I thought was led to by

chown: cannot dereference '/proc/1/fd/1': Permission denied
chown: cannot dereference '/proc/1/fd/2': Permission denied

thanks for clarifying!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tdaleibm picture tdaleibm  路  5Comments

zedesk picture zedesk  路  3Comments

imaia picture imaia  路  6Comments

davStar picture davStar  路  3Comments

sri85 picture sri85  路  7Comments