Mongo: Windows 10, Docker and Mongo: Operation not permitted, terminating

Created on 11 Jul 2017  路  5Comments  路  Source: docker-library/mongo

We are running Windows 10 with HyperV and Mongo.

There is a mounted volume to a local data directory. This works in Unix and Mac just fine. We read that this doesn't work in Windows 10 and it's simply not true.

The first time, it works. Then when we stop down mongo and recompose, we get the following error.

If we restart the Docker Service, then it works again until we stop and start Mongo.

mongo      | 2017-07-12T01:55:17.504+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating

Any thoughts or work arounds would be greatly appreciated. Thanks!

Attaching to mongo
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=0bb1e3123750
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten] db version v3.5.9
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten] git version: d5e9b4994557285017795d9ed9129341314da202
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten] allocator: tcmalloc
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten] modules: none
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten] build environment:
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten]     distmod: debian81
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten]     distarch: x86_64
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten]     target_arch: x86_64
mongo      | 2017-07-12T01:55:17.485+0000 I CONTROL  [initandlisten] options: { net: { bindIpAll: true } }
mongo      | 2017-07-12T01:55:17.489+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=481M,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),
mongo      | 2017-07-12T01:55:17.502+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1499824517:502361][1:0x7f24061bed40], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo      | 2017-07-12T01:55:17.504+0000 E -        [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 325
mongo      | 2017-07-12T01:55:17.504+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating
mongo      | 2017-07-12T01:55:17.504+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
mongo      | 2017-07-12T01:55:17.504+0000 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
mongo      | 2017-07-12T01:55:17.504+0000 I CONTROL  [initandlisten] now exiting
mongo      | 2017-07-12T01:55:17.504+0000 I CONTROL  [initandlisten] shutting down with code:100
mongo exited with code 100

Most helpful comment

I "fix it" using "Docker Volumes" instead of mounting a directory.

All 5 comments

Currently experiencing a similar issue with Arch Linux.

% docker -v
Docker version 17.07.0-ce, build 87847530f7
% docker volume create mongodb-data
mongodb-data

% docker pull mongo:latest
latest: Pulling from library/mongo
Digest: sha256:bb962ca3964c70069e652e814f7a495db19643ecb5bb62d799f621a68f4da90c
Status: Image is up to date for mongo:latest

% docker run --name mongodb --mount source=mongodb-data,target=/data/db -it mongo:latest --auth
2017-09-24T07:54:43.693+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=3c184948ce5a
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten] db version v3.4.9
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten] git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten] modules: none
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten] build environment:
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten]     distmod: debian81
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten]     distarch: x86_64
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2017-09-24T07:54:43.694+0000 I CONTROL  [initandlisten] options: { security: { authorization: "enabled" } }
2017-09-24T07:54:43.699+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=5475M,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-09-24T07:54:43.998+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1506239683:998366][1:0x7f124d450d40], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2017-09-24T07:54:43.999+0000 I -        [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 269
2017-09-24T07:54:44.001+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating
2017-09-24T07:54:44.001+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2017-09-24T07:54:44.001+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2017-09-24T07:54:44.001+0000 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2017-09-24T07:54:44.001+0000 I CONTROL  [initandlisten] now exiting
2017-09-24T07:54:44.001+0000 I CONTROL  [initandlisten] shutting down with code:100

Without a data volume:
% docker run --name mongodb -it mongo:latest --auth 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=4bb5e913b483 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] db version v3.4.9 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t 3 May 2016 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] allocator: tcmalloc 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] modules: none 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] build environment: 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] distmod: debian81 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] distarch: x86_64 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] target_arch: x86_64 2017-09-24T07:57:09.491+0000 I CONTROL [initandlisten] options: { security: { authorization: "enabled" } } 2017-09-24T07:57:09.504+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=5475M,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-09-24T07:57:09.745+0000 E STORAGE [initandlisten] WiredTiger error (1) [1506239829:744983][1:0x7fbbf2b81d40], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted 2017-09-24T07:57:09.746+0000 I - [initandlisten] Assertion: 28595:1: Operation not permitted src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 269 2017-09-24T07:57:09.749+0000 I STORAGE [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating 2017-09-24T07:57:09.749+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets... 2017-09-24T07:57:09.749+0000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock 2017-09-24T07:57:09.749+0000 I NETWORK [initandlisten] shutdown: going to flush diaglog... 2017-09-24T07:57:09.749+0000 I CONTROL [initandlisten] now exiting 2017-09-24T07:57:09.749+0000 I CONTROL [initandlisten] shutting down with code:100

This issue seems to be related to NTFS filesystems.

I was starting docker with /usr/bin/dockerd -H fd:// -g <path-to-ntfs-mount> (-g <path> saves images, containers, etc. at <path>)

After changing -g <path> to an ext4 formatted drive, the permission issue was gone.

Thanks @mkroman -- indeed, any limitations on the underlying filesystem are going to be issues with how MongoDB upstream uses files, and not something specific to this image.

Something that might be of interest is that we do have Windows variants of this image which run MongoDB natively on Windows Server Core, and that will likely have more success with Windows filesystems. :+1:

I "fix it" using "Docker Volumes" instead of mounting a directory.

I "fix it" using "Docker Volumes" instead of mounting a directory.

who to do

Was this page helpful?
0 / 5 - 0 ratings