Skip to content

Image mongo:3.4.2 won't start #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
calas opened this issue Mar 29, 2017 · 10 comments
Closed

Image mongo:3.4.2 won't start #158

calas opened this issue Mar 29, 2017 · 10 comments

Comments

@calas
Copy link

calas commented Mar 29, 2017

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

@ToSa27
Copy link

ToSa27 commented Mar 30, 2017

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

@faustman
Copy link

faustman commented Apr 3, 2017

Unfortunately, same for me. Dropped comment to #158

@calas
Copy link
Author

calas commented Apr 3, 2017

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

@errnoh
Copy link

errnoh commented Apr 11, 2017

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)

@elouanKeryell-Even
Copy link

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

@errnoh
Copy link

errnoh commented Apr 11, 2017

@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?

@yosifkit
Copy link
Member

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

All, we added some fixes in #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.

mmagr pushed a commit to dojot/docker-compose that referenced this issue Aug 22, 2017
Current public docker of mongodb has an issue with SELinux -
it won't spawn child processes using the default user (root) -
as described here: docker-library/mongo#158

Apparently setting the user as 'mongodb' fixed this issue (or
disabling SELinux altogether, but this might be a major concern)

Change-Id: I8564b5211a5296606f5d4ede8d7fe2dffecb1524
mmagr pushed a commit to mmagr/dojot-ppc64le that referenced this issue Oct 10, 2017
Current public docker of mongodb has an issue with SELinux -
it won't spawn child processes using the default user (root) -
as described here: docker-library/mongo#158

Apparently setting the user as 'mongodb' fixed this issue (or
disabling SELinux altogether, but this might be a major concern)

Change-Id: I8564b5211a5296606f5d4ede8d7fe2dffecb1524
@lehnerchristian
Copy link

lehnerchristian commented Nov 15, 2018

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?

@tianon
Copy link
Member

tianon commented Nov 15, 2018 via email

@lehnerchristian
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants