Skip to content

Docker Image mongo:3.2 won't start because of Permission denied #154

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
stemau98 opened this issue Mar 23, 2017 · 13 comments
Closed

Docker Image mongo:3.2 won't start because of Permission denied #154

stemau98 opened this issue Mar 23, 2017 · 13 comments

Comments

@stemau98
Copy link

Following output is displayed if container is started:
chown: changing ownership of '/dev/stdout': Permission denied
chown: changing ownership of '/dev/stderr': Permission denied

Please fix this in docker-entrypoint.sh

@aopetrov86
Copy link

aopetrov86 commented Mar 23, 2017

I've got the same issue.

docker run --name some-mongo mongo

chown: changing ownership of '/dev/stdout': Permission denied
chown: changing ownership of '/dev/stderr': Permission denied

cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

uname -a

Linux docker-node 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

docker version

Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:10:07 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:10:07 2017
OS/Arch: linux/amd64
Experimental: false

docker image inspect mongo

[
    {
        "Id": "sha256:ffae984aa30cfde62ca06d127b65b5d37252b89ad407d0c2c632212d52ba58ca",
        "RepoTags": [
            "mongo:latest"
        ],
        "RepoDigests": [
            "mongo@sha256:e5a4f6caf4fb6773e41292b56308ed427692add67ffd7c655fdf11a78a72df4e"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2017-03-21T18:27:48.94406564Z",
        "Container": "2f4eef809837f7184b072d3536a2f71c16f41dcfb674fc52a1ef406de6a41313",
        "ContainerConfig": {
            "Hostname": "15ebb19d5ddb",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "27017/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.7",
                "GPG_KEYS=0C49F3730359A14518585931BC711F9BA15703C6",
                "MONGO_MAJOR=3.4",
                "MONGO_VERSION=3.4.2",
                "MONGO_PACKAGE=mongodb-org"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "CMD [\"mongod\"]"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:70f490c1f75d8b83fa78563bfcff681c16d77553ba0d4780c62a9008b2fee1b3",
            "Volumes": {
                "/data/configdb": {},
                "/data/db": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "1.12.6",
        "Author": "",
        "Config": {
            "Hostname": "15ebb19d5ddb",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "27017/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.7",
                "GPG_KEYS=0C49F3730359A14518585931BC711F9BA15703C6",
                "MONGO_MAJOR=3.4",
                "MONGO_VERSION=3.4.2",
                "MONGO_PACKAGE=mongodb-org"
            ],
            "Cmd": [
                "mongod"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:70f490c1f75d8b83fa78563bfcff681c16d77553ba0d4780c62a9008b2fee1b3",
            "Volumes": {
                "/data/configdb": {},
                "/data/db": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 358964731,
        "VirtualSize": 358964731,
        "GraphDriver": {
            "Name": "overlay",
            "Data": {
                "RootDir": "/var/lib/docker/overlay/a737e1148a57aed1362100567229e2ed1ad29dacbee93c84dceed1838fed64fc/root"
            }
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:483da7fbbc1a693d269f42733de4b60db96a2157be65a100c0a0cfe002327ecc",
                "sha256:144cfca37e38cadb4a046b24d4472bd2ca9f996e183fd97e6975428858f37dc0",
                "sha256:92c7f3c3f729bdcc7226e10afe036607b5a6f9d2617cf329e604823d5d761b0e",
                "sha256:0f58e2d21079e1914a74c107af538f2335935671756d237d75c182eb7ee3b360",
                "sha256:29f5883477dbf074ea34ad109bf5819de47c53e64f0ab238d180b03c997365d3",
                "sha256:a5fe28d6e759f4cce422f697978a7feab82c0027138f9a20098ae58d924b9b2b",
                "sha256:2febb6f8ed4e89df5427ca30bd49c4538df865e15ed2e6bf6a1182c2dc69289f",
                "sha256:0c1029e243e98b3e5547fb8a01e27f04336b14fc7fe23bd078a581a9b6a2b4e0",
                "sha256:8b59e97d607e5d01fb5624cc3ac136f25b4a45c462c167b0b4220532b2c903bb",
                "sha256:6a4ae0bc9ea79d78c2e9980a3956bf5ebc5095831f7b3fb1a2bc7b7e827b4163",
                "sha256:96e178a2cc3f4b1295cf0b878ceda5526590066c17b76bd61c04ab8d9ea5746d"
            ]
        }
    }
]

@aopetrov86
Copy link

But not here.

cat /etc/upstream-release/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial

uname -a

Linux laptop 4.4.0-67-generic #88-Ubuntu SMP Wed Mar 8 16:34:45 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

docker version

Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 11:02:43 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 11:02:43 2017
OS/Arch: linux/amd64
Experimental: false

docker image inspect mongo

[
    {
        "Id": "sha256:ffae984aa30cfde62ca06d127b65b5d37252b89ad407d0c2c632212d52ba58ca",
        "RepoTags": [
            "mongo:latest"
        ],
        "RepoDigests": [
            "mongo@sha256:e5a4f6caf4fb6773e41292b56308ed427692add67ffd7c655fdf11a78a72df4e"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2017-03-21T18:27:48.94406564Z",
        "Container": "2f4eef809837f7184b072d3536a2f71c16f41dcfb674fc52a1ef406de6a41313",
        "ContainerConfig": {
            "Hostname": "15ebb19d5ddb",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "27017/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.7",
                "GPG_KEYS=0C49F3730359A14518585931BC711F9BA15703C6",
                "MONGO_MAJOR=3.4",
                "MONGO_VERSION=3.4.2",
                "MONGO_PACKAGE=mongodb-org"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "CMD [\"mongod\"]"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:70f490c1f75d8b83fa78563bfcff681c16d77553ba0d4780c62a9008b2fee1b3",
            "Volumes": {
                "/data/configdb": {},
                "/data/db": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "1.12.6",
        "Author": "",
        "Config": {
            "Hostname": "15ebb19d5ddb",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "27017/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.7",
                "GPG_KEYS=0C49F3730359A14518585931BC711F9BA15703C6",
                "MONGO_MAJOR=3.4",
                "MONGO_VERSION=3.4.2",
                "MONGO_PACKAGE=mongodb-org"
            ],
            "Cmd": [
                "mongod"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:70f490c1f75d8b83fa78563bfcff681c16d77553ba0d4780c62a9008b2fee1b3",
            "Volumes": {
                "/data/configdb": {},
                "/data/db": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 358986787,
        "VirtualSize": 358986787,
        "GraphDriver": {
            "Name": "aufs",
            "Data": null
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:483da7fbbc1a693d269f42733de4b60db96a2157be65a100c0a0cfe002327ecc",
                "sha256:144cfca37e38cadb4a046b24d4472bd2ca9f996e183fd97e6975428858f37dc0",
                "sha256:92c7f3c3f729bdcc7226e10afe036607b5a6f9d2617cf329e604823d5d761b0e",
                "sha256:0f58e2d21079e1914a74c107af538f2335935671756d237d75c182eb7ee3b360",
                "sha256:29f5883477dbf074ea34ad109bf5819de47c53e64f0ab238d180b03c997365d3",
                "sha256:a5fe28d6e759f4cce422f697978a7feab82c0027138f9a20098ae58d924b9b2b",
                "sha256:2febb6f8ed4e89df5427ca30bd49c4538df865e15ed2e6bf6a1182c2dc69289f",
                "sha256:0c1029e243e98b3e5547fb8a01e27f04336b14fc7fe23bd078a581a9b6a2b4e0",
                "sha256:8b59e97d607e5d01fb5624cc3ac136f25b4a45c462c167b0b4220532b2c903bb",
                "sha256:6a4ae0bc9ea79d78c2e9980a3956bf5ebc5095831f7b3fb1a2bc7b7e827b4163",
                "sha256:96e178a2cc3f4b1295cf0b878ceda5526590066c17b76bd61c04ab8d9ea5746d"
            ]
        }
    }
]

@aopetrov86
Copy link

aopetrov86 commented Mar 23, 2017

Workaround

docker run --name some-mongo mongo bash -c "echo 1 && mongod --auth"

Bug start from 3.4/docker-entrypoint.sh#L10

Commit: 27f2722 @tianon tianon committed 8 days ago

@tianon
Copy link
Member

tianon commented Mar 23, 2017

This is a duplicate of #149, fixed in #151. See docker-library/official-images#2780 for progress on getting this image updated on the Hub (which will happen before EOD today). 👍

@tianon tianon closed this as completed Mar 23, 2017
@stemau98
Copy link
Author

Actually I pulled the new image and get this error in the logs:

chown: changing ownership of '/proc/1/fd/1': Permission denied
chown: changing ownership of '/proc/1/fd/2': Permission denied
about to fork child process, waiting until server is ready for connections.
forked process: 18
ERROR: child process failed, exited with error number 1

@tianon
Copy link
Member

tianon commented Mar 24, 2017

@stemau98 can you please try running the image with --user mongodb and paste the full log? (so that the daemon it starts can actually write to stdout/stderr and we can see what the real error is)

ie:

$ docker run -it --rm --user mongodb mongo:3.4
about to fork child process, waiting until server is ready for connections.
forked process: 12
2017-03-24T20:26:09.652+0000 I CONTROL  [initandlisten] MongoDB starting : pid=12 port=27017 dbpath=/data/db 64-bit host=8ca88681e10a
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten] db version v3.4.2
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten] modules: none
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten] build environment:
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten]     distmod: debian81
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten]     distarch: x86_64
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2017-03-24T20:26:09.653+0000 I CONTROL  [initandlisten] options: { net: { bindIp: "127.0.0.1" }, processManagement: { fork: true, pidFilePath: "/tmp/tmp.Lh96uZj1Ee" }, systemLog: { destination: "file", path: "/proc/1/fd/1" } }
2017-03-24T20:26:09.663+0000 I STORAGE  [initandlisten] 
2017-03-24T20:26:09.663+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-03-24T20:26:09.663+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-03-24T20:26:09.663+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=15562M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-03-24T20:26:09.994+0000 I CONTROL  [initandlisten] 
2017-03-24T20:26:09.994+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-03-24T20:26:09.994+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-03-24T20:26:09.994+0000 I CONTROL  [initandlisten] 
2017-03-24T20:26:10.066+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2017-03-24T20:26:10.179+0000 I INDEX    [initandlisten] build index on: admin.system.version properties: { v: 2, key: { version: 1 }, name: "incompatible_with_version_32", ns: "admin.system.version" }
2017-03-24T20:26:10.180+0000 I INDEX    [initandlisten] 	 building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2017-03-24T20:26:10.181+0000 I INDEX    [initandlisten] build index done.  scanned 0 total records. 0 secs
2017-03-24T20:26:10.182+0000 I COMMAND  [initandlisten] setting featureCompatibilityVersion to 3.4
2017-03-24T20:26:10.183+0000 I NETWORK  [thread1] waiting for connections on port 27017
child process started successfully, parent exiting
2017-03-24T20:26:10.254+0000 I NETWORK  [thread1] connection accepted from 127.0.0.1:59408 #1 (1 connection now open)
2017-03-24T20:26:10.254+0000 I NETWORK  [conn1] received client metadata from 127.0.0.1:59408 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.4.2" }, os: { type: "Linux", name: "PRETTY_NAME="Debian GNU/Linux 8 (jessie)"", architecture: "x86_64", version: "Kernel 4.4.52-gentoo" } }
2017-03-24T20:26:10.257+0000 I -        [conn1] end connection 127.0.0.1:59408 (1 connection now open)

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

killing process with pid: 12
2017-03-24T20:26:10.284+0000 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2017-03-24T20:26:10.284+0000 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2017-03-24T20:26:10.284+0000 I NETWORK  [signalProcessingThread] closing listening socket: 7
2017-03-24T20:26:10.284+0000 I NETWORK  [signalProcessingThread] closing listening socket: 8
2017-03-24T20:26:10.284+0000 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2017-03-24T20:26:10.285+0000 I NETWORK  [signalProcessingThread] shutdown: going to flush diaglog...
2017-03-24T20:26:10.285+0000 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2017-03-24T20:26:10.285+0000 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2017-03-24T20:26:10.616+0000 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2017-03-24T20:26:10.617+0000 I CONTROL  [signalProcessingThread] now exiting
2017-03-24T20:26:10.617+0000 I CONTROL  [signalProcessingThread] shutting down with code:0

MongoDB init process complete; ready for start up.

2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=8ca88681e10a
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten] db version v3.4.2
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten] modules: none
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten] build environment:
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten]     distmod: debian81
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten]     distarch: x86_64
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2017-03-24T20:26:11.313+0000 I CONTROL  [initandlisten] options: {}
2017-03-24T20:26:11.319+0000 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-03-24T20:26:11.319+0000 I STORAGE  [initandlisten] 
2017-03-24T20:26:11.319+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-03-24T20:26:11.319+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-03-24T20:26:11.319+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=15562M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-03-24T20:26:12.256+0000 I CONTROL  [initandlisten] 
2017-03-24T20:26:12.256+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-03-24T20:26:12.256+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-03-24T20:26:12.256+0000 I CONTROL  [initandlisten] 
2017-03-24T20:26:12.259+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2017-03-24T20:26:12.260+0000 I NETWORK  [thread1] waiting for connections on port 27017

@stemau98
Copy link
Author

@tianon Starting the container with --user mongodb solved the problem. It would be a good idea to add this to the docs on Docker Hub.
Thx for your support!

@jonathonf
Copy link

Hrm... I'm hitting this even when setting --user mongodb:

# docker run -it --rm --user mongodb mongo:3.4
about to fork child process, waiting until server is ready for connections.
forked process: 10
ERROR: child process failed, exited with error number 1

(Docker CE 17.03.1 and 17.04 on an Ubuntu 14.04 system (64-bit, with kernel 4.4.0-72))

@gottfrois
Copy link

yep same issue here when pulling mongo:3.2 or 3.4

@thiagovsk
Copy link

@jonathonf me too

about to fork child process, waiting until server is ready for connections.
forked process: 13
ERROR: child process failed, exited with error number 1

Ubuntu 14.04 3.13.0-32-generic
Docker version 1.12.6, build 78d1802
docker image mongo 3.4

@maxim28
Copy link

maxim28 commented Apr 13, 2017

same issue when pulling latest image
here is the logs without mongodb user:

docker run --rm --name fail-mongo 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: 17
ERROR: child process failed, exited with error number 1

and here is the logs with mongodb user:

docker run -u mongodb --rm --name success-mongo mongo
about to fork child process, waiting until server is ready for connections.
forked process: 11
2017-04-13T04:02:54.151+0000 I CONTROL  [initandlisten] MongoDB starting : pid=11 port=27017 dbpath=/data/db 64-bit host=4998c588ab8e
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten] db version v3.4.3
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten] git version: f07437fb5a6cca07c10bafa78365456eb1d6d5e1
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten] modules: none
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten] build environment:
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten]     distmod: debian81
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten]     distarch: x86_64
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2017-04-13T04:02:54.162+0000 I CONTROL  [initandlisten] options: { net: { bindIp: "127.0.0.1", port: 27017, ssl: { mode: "disabled" } }, processManagement: { fork: true, pidFilePath: "/tmp/tmp.FvzqOLJOFh" }, systemLog: { destination: "file", path: "/proc/1/fd/1" } }
2017-04-13T04:02:54.167+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1384M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-04-13T04:02:54.310+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:54.310+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-04-13T04:02:54.310+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-04-13T04:02:54.310+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:54.311+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:54.311+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-04-13T04:02:54.311+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-04-13T04:02:54.311+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:54.311+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-04-13T04:02:54.311+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-04-13T04:02:54.311+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:54.362+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2017-04-13T04:02:54.416+0000 I INDEX    [initandlisten] build index on: admin.system.version properties: { v: 2, key: { version: 1 }, name: "incompatible_with_version_32", ns: "admin.system.version" }
2017-04-13T04:02:54.416+0000 I INDEX    [initandlisten] 	 building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2017-04-13T04:02:54.421+0000 I INDEX    [initandlisten] build index done.  scanned 0 total records. 0 secs
2017-04-13T04:02:54.421+0000 I COMMAND  [initandlisten] setting featureCompatibilityVersion to 3.4
child process started successfully, parent exiting
2017-04-13T04:02:54.423+0000 I NETWORK  [thread1] waiting for connections on port 27017
2017-04-13T04:02:54.652+0000 I NETWORK  [thread1] connection accepted from 127.0.0.1:58563 #1 (1 connection now open)
2017-04-13T04:02:54.652+0000 I NETWORK  [conn1] received client metadata from 127.0.0.1:58563 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.4.3" }, os: { type: "Linux", name: "PRETTY_NAME="Debian GNU/Linux 8 (jessie)"", architecture: "x86_64", version: "Kernel 3.10.0-123.el7.x86_64" } }

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

2017-04-13T04:02:54.680+0000 I -        [conn1] end connection 127.0.0.1:58563 (1 connection now open)
killing process with pid: 11
2017-04-13T04:02:54.689+0000 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2017-04-13T04:02:54.689+0000 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2017-04-13T04:02:54.689+0000 I NETWORK  [signalProcessingThread] closing listening socket: 7
2017-04-13T04:02:54.689+0000 I NETWORK  [signalProcessingThread] closing listening socket: 8
2017-04-13T04:02:54.689+0000 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2017-04-13T04:02:54.689+0000 I NETWORK  [signalProcessingThread] shutdown: going to flush diaglog...
2017-04-13T04:02:54.689+0000 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2017-04-13T04:02:54.691+0000 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2017-04-13T04:02:54.882+0000 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2017-04-13T04:02:54.883+0000 I CONTROL  [signalProcessingThread] now exiting
2017-04-13T04:02:54.883+0000 I CONTROL  [signalProcessingThread] shutting down with code:0

MongoDB init process complete; ready for start up.

2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=4998c588ab8e
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten] db version v3.4.3
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten] git version: f07437fb5a6cca07c10bafa78365456eb1d6d5e1
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten] modules: none
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten] build environment:
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten]     distmod: debian81
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten]     distarch: x86_64
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2017-04-13T04:02:55.711+0000 I CONTROL  [initandlisten] options: {}
2017-04-13T04:02:55.715+0000 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-04-13T04:02:55.715+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1384M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-04-13T04:02:56.291+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:56.291+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-04-13T04:02:56.291+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-04-13T04:02:56.291+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:56.292+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:56.292+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-04-13T04:02:56.292+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-04-13T04:02:56.292+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:56.292+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-04-13T04:02:56.292+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-04-13T04:02:56.292+0000 I CONTROL  [initandlisten]
2017-04-13T04:02:56.295+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2017-04-13T04:02:56.296+0000 I NETWORK  [thread1] waiting for connections on port 27017

@gregfr
Copy link

gregfr commented Feb 20, 2023

Same error today with the official installation procedure (https://hub.docker.com/_/mongo):

warning: initdb logs cannot write to '/proc/1/fd/1', so they are in '/data/db/docker-initdb.log' instead
about to fork child process, waiting until server is ready for connections.
forked process: 29
ERROR: child process failed, exited with 51
To see additional information in this output, start without the "--fork" option.

@yosifkit
Copy link
Member

@gregfr, this issue is quite old and likely does not have the same cause, please open a new issue with more details and logs. For example: does it also fail while running with --user mongodb? what was your exact docker run line? Host information, docker version, or other information that will help us reproduce it?

@docker-library docker-library locked as resolved and limited conversation to collaborators Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants