-
Notifications
You must be signed in to change notification settings - Fork 649
Cannot start container due to the "unknown error" #358
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
Comments
Are you running selinux or apparmor? Is there anything notable with your environment such as being mac/windows? |
I work on Windows 7 environment. Should this be an issue ? |
Docker for Windows and Linux Containers on Windows (LCOW) are experimental when running Linux containers, due to the syscall translations and with any host->container volume mounts as Docker for Windows uses VirtualBox https://www.virtualbox.org/ticket/819 LCOW uses Hyper-V however there's still syscall translations for NTFS->POSIX You can try Docker named volumes in such cases MariaDB/mariadb-docker#152 (comment) |
Hello I've mounted a volume to /tmp directory where error was showing up. version: '3.7'
services:
mongodb:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
volumes:
- ./tmp:/tmp But now other error comes up:
I use Docker with VirtualBox + DockerTools |
I'd suggest using the Windows containers https://github.com/docker-library/mongo/tree/master/4.1/windows For further help you could try asking the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since this isn't something we can fix in the image, but is a Docker for Windows issue with Linux containers |
This is strange, other linux based containers seem to work without problem like: mysql, nginx, php etc. all virtualized on linuxes like alpine:3.10 works great, but your distribution seems to have problem ubuntu:bionic maybe this is a problem. I can't really use Windows container because i don't think Windows 7 supports it. |
Unable to reproduce on Windows 10 Home using docker-toolbox (i.e. docker-machine, boot2docker, and Oracle VirtualBox). $ docker version
Client:
Version: 18.09.3
API version: 1.39
Go version: go1.12
Git commit: 774a1f4eee
Built: Mon Mar 4 10:36:44 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.4
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: d14af54
Built: Wed Mar 27 18:41:10 2019
OS/Arch: linux/amd64
Experimental: false
$ cat docker-compose.yml
version: '3.7'
services:
mongodb:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
$ docker-compose run mongodb
Creating network "mongo_default" with the default driver
Pulling mongodb (mongo:)...
latest: Pulling from library/mongo
35b42117c431: Pull complete
ad9c569a8d98: Pull complete
293b44f45162: Pull complete
0c175077525d: Pull complete
4e73525b52ba: Pull complete
a22695a3f5e9: Pull complete
c5175bcf2977: Pull complete
3e320da07793: Pull complete
01c6db6b2b5a: Pull complete
3bd6e9d03e78: Pull complete
e03dcf51513f: Pull complete
c1956a9e136a: Pull complete
4c35cf22b1d5: Pull complete
about to fork child process, waiting until server is ready for connections.
forked process: 24
2019-07-22T22:37:50.278+0000 I CONTROL [main] ***** SERVER RESTARTED *****
2019-07-22T22:37:50.282+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-07-22T22:37:50.287+0000 I CONTROL [initandlisten] MongoDB starting : pid=24 port=27017 dbpath=/data/db 64-bit host=07b69c2d9489
2019-07-22T22:37:50.287+0000 I CONTROL [initandlisten] db version v4.0.10
2019-07-22T22:37:50.288+0000 I CONTROL [initandlisten] git version: c389e7f69f637f7a1ac3cc9fae843b635f20b766
2019-07-22T22:37:50.289+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2019-07-22T22:37:50.290+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-07-22T22:37:50.291+0000 I CONTROL [initandlisten] modules: none
2019-07-22T22:37:50.291+0000 I CONTROL [initandlisten] build environment:
2019-07-22T22:37:50.292+0000 I CONTROL [initandlisten] distmod: ubuntu1604
2019-07-22T22:37:50.293+0000 I CONTROL [initandlisten] distarch: x86_64
2019-07-22T22:37:50.294+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-07-22T22:37:50.294+0000 I CONTROL [initandlisten] options: { net: { bindIp: "127.0.0.1", port: 27017, ssl: { mode: "disabled" } }, processManagement: { fork: true, pidFilePath: "/tmp/docker-entrypoint-temp-mongod.pid" }, systemLog: { destination: "file", logAppend: true, path: "/proc/1/fd/1" } }
2019-07-22T22:37:50.295+0000 I STORAGE [initandlisten]
2019-07-22T22:37:50.296+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-07-22T22:37:50.296+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-07-22T22:37:50.297+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=256M,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),statistics_log=(wait=0),verbose=(recovery_progress),
2019-07-22T22:37:50.951+0000 I STORAGE [initandlisten] WiredTiger message [1563835070:951919][24:0x7fb0d4feba80], txn-recover: Set global recovery timestamp: 0
2019-07-22T22:37:50.959+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2019-07-22T22:37:50.969+0000 I CONTROL [initandlisten]
2019-07-22T22:37:50.970+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-07-22T22:37:50.970+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2019-07-22T22:37:50.970+0000 I CONTROL [initandlisten]
2019-07-22T22:37:50.972+0000 I STORAGE [initandlisten] createCollection: admin.system.version with provided UUID: 92813a1b-5787-402d-a0ad-25fad77a0d2c
2019-07-22T22:37:50.984+0000 I COMMAND [initandlisten] setting featureCompatibilityVersion to 4.0
2019-07-22T22:37:50.996+0000 I STORAGE [initandlisten] createCollection: local.startup_log with generated UUID: 791bd120-2b2e-461e-8388-ae4992a44163
2019-07-22T22:37:51.006+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2019-07-22T22:37:51.009+0000 I NETWORK [initandlisten] waiting for connections on port 27017
child process started successfully, parent exiting
2019-07-22T22:37:51.014+0000 I STORAGE [LogicalSessionCacheRefresh] createCollection: config.system.sessions with generated UUID: 40953d3d-b668-4086-acd7-0d0b26fe2e8f
2019-07-22T22:37:51.036+0000 I INDEX [LogicalSessionCacheRefresh] build index on: config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lsidTTLIndex", ns: "config.system.sessions", expireAfterSeconds: 1800 }
2019-07-22T22:37:51.036+0000 I INDEX [LogicalSessionCacheRefresh] building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2019-07-22T22:37:51.042+0000 I INDEX [LogicalSessionCacheRefresh] build index done. scanned 0 total records. 0 secs
2019-07-22T22:37:51.104+0000 I NETWORK [listener] connection accepted from 127.0.0.1:38584 #1 (1 connection now open)
2019-07-22T22:37:51.106+0000 I NETWORK [conn1] received client metadata from 127.0.0.1:38584 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.10" }, os: { type: "Linux", name: "Ubuntu", architecture: "x86_64", version: "16.04" } }
2019-07-22T22:37:51.111+0000 I NETWORK [conn1] end connection 127.0.0.1:38584 (0 connections now open)
2019-07-22T22:37:51.181+0000 I NETWORK [listener] connection accepted from 127.0.0.1:38586 #2 (1 connection now open)
2019-07-22T22:37:51.182+0000 I NETWORK [conn2] received client metadata from 127.0.0.1:38586 conn2: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.10" }, os: { type: "Linux", name: "Ubuntu", architecture: "x86_64", version: "16.04" } }
2019-07-22T22:37:51.226+0000 I STORAGE [conn2] createCollection: admin.system.users with generated UUID: eecb2488-18db-403d-9c4b-cda36fc66358
Successfully added user: {
"user" : "root",
"roles" : [
{
"role" : "root",
"db" : "admin"
}
]
}
2019-07-22T22:37:51.248+0000 E - [main] Error saving history file: FileOpenFailed: Unable to open() file /home/mongodb/.dbshell: Unknown error
2019-07-22T22:37:51.252+0000 I NETWORK [conn2] end connection 127.0.0.1:38586 (0 connections now open)
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2019-07-22T22:37:51.275+0000 I CONTROL [main] ***** SERVER RESTARTED *****
2019-07-22T22:37:51.279+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
killing process with pid: 24
2019-07-22T22:37:51.283+0000 I CONTROL [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2019-07-22T22:37:51.284+0000 I NETWORK [signalProcessingThread] shutdown: going to close listening sockets...
2019-07-22T22:37:51.284+0000 I NETWORK [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2019-07-22T22:37:51.285+0000 I CONTROL [signalProcessingThread] Shutting down free monitoring
2019-07-22T22:37:51.285+0000 I FTDC [signalProcessingThread] Shutting down full-time diagnostic data capture
2019-07-22T22:37:51.286+0000 I STORAGE [signalProcessingThread] WiredTigerKVEngine shutting down
2019-07-22T22:37:51.287+0000 I STORAGE [signalProcessingThread] Shutting down session sweeper thread
2019-07-22T22:37:51.288+0000 I STORAGE [signalProcessingThread] Finished shutting down session sweeper thread
2019-07-22T22:37:51.398+0000 I STORAGE [signalProcessingThread] shutdown: removing fs lock...
2019-07-22T22:37:51.399+0000 I CONTROL [signalProcessingThread] now exiting
2019-07-22T22:37:51.400+0000 I CONTROL [signalProcessingThread] shutting down with code:0
MongoDB init process complete; ready for start up.
2019-07-22T22:37:52.363+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-07-22T22:37:52.367+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=07b69c2d9489
2019-07-22T22:37:52.367+0000 I CONTROL [initandlisten] db version v4.0.10
2019-07-22T22:37:52.368+0000 I CONTROL [initandlisten] git version: c389e7f69f637f7a1ac3cc9fae843b635f20b766
2019-07-22T22:37:52.368+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2019-07-22T22:37:52.369+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-07-22T22:37:52.369+0000 I CONTROL [initandlisten] modules: none
2019-07-22T22:37:52.370+0000 I CONTROL [initandlisten] build environment:
2019-07-22T22:37:52.370+0000 I CONTROL [initandlisten] distmod: ubuntu1604
2019-07-22T22:37:52.371+0000 I CONTROL [initandlisten] distarch: x86_64
2019-07-22T22:37:52.371+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-07-22T22:37:52.372+0000 I CONTROL [initandlisten] options: { net: { bindIpAll: true }, security: { authorization: "enabled" } }
2019-07-22T22:37:52.374+0000 I STORAGE [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2019-07-22T22:37:52.374+0000 I STORAGE [initandlisten]
2019-07-22T22:37:52.375+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-07-22T22:37:52.375+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-07-22T22:37:52.375+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=256M,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),statistics_log=(wait=0),verbose=(recovery_progress),
2019-07-22T22:37:53.205+0000 I STORAGE [initandlisten] WiredTiger message [1563835073:205244][1:0x7f6ff5b5ca80], txn-recover: Main recovery loop: starting at 1/27264 to 2/256
2019-07-22T22:37:53.303+0000 I STORAGE [initandlisten] WiredTiger message [1563835073:303547][1:0x7f6ff5b5ca80], txn-recover: Recovering log 1 through 2
2019-07-22T22:37:53.369+0000 I STORAGE [initandlisten] WiredTiger message [1563835073:369105][1:0x7f6ff5b5ca80], txn-recover: Recovering log 2 through 2
2019-07-22T22:37:53.417+0000 I STORAGE [initandlisten] WiredTiger message [1563835073:417097][1:0x7f6ff5b5ca80], txn-recover: Set global recovery timestamp: 0
2019-07-22T22:37:53.441+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2019-07-22T22:37:53.510+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2019-07-22T22:37:53.512+0000 I NETWORK [initandlisten] waiting for connections on port 27017 |
I'm working on Windows 7 Home Edition + Virtual Box.
If I add volumes like this: version: '3.7'
services:
mongodb:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
volumes:
- ./tmp:/tmp I get other error:
|
I tried also to run the container with /bin/bash with following result:
So... it seems to work this way, but.... when i try to connect with mongo-express i get
Still i can connect to the database from inside the container like this:
.... so something might be up with creating connections by the container |
When you give a non-mongo command when running the image it bypasses the entrypoint.sh which initializes mongo |
OMG LOL, I finally found out what the issue was:
@wglambert You proposed mount the volume which was actually bad idea, because it was causing the second error:
But after cleaning up docker VOLUMES, with command: version: '3.7'
services:
mongodb:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
#restart: always
ports: ['27017:27017']
mongo-express:
image: mongo-express
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
# this must correspond to the name of the Mongo DB service name
ME_CONFIG_MONGODB_SERVER: mongodb Worth to mention that unfortunately following commands WON'T do the trick: |
When i run the image with following docker-compose.yml.
Using command:
docker-compose run mongodb
ordocker-compose up --build
(both give same results)I get this error:
I tried following steps:
Non of them works. Can anyone help here ?
The text was updated successfully, but these errors were encountered: