Skip to content
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

Docker + Windows + MongoDB -> std. Laradock fails. #1663

Closed
jvihrial opened this issue Jun 28, 2018 · 13 comments
Closed

Docker + Windows + MongoDB -> std. Laradock fails. #1663

jvihrial opened this issue Jun 28, 2018 · 13 comments

Comments

@jvihrial
Copy link

Info:

  • Docker version: Docker version 18.03.1-ce, build 9ee9f40
  • Laradock commit: cd1c56c
  • System info (Mac, PC, Linux): PC
  • System info disto/version: Windows 10 1803

Issue:

MongoDB fails to start. In throws fatal exception code 14 and dies:

mongo_1 | 2018-06-28T16:29:52.560+0000 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=9fc24b843ae9
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] db version v4.0.0
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] allocator: tcmalloc
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] modules: none
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] build environment:
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] distmod: ubuntu1604
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] distarch: x86_64
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] target_arch: x86_64
mongo_1 | 2018-06-28T16:29:52.566+0000 I CONTROL [initandlisten] options: { net: { bindIpAll: true } }
mongo_1 | 2018-06-28T16:29:52.573+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=478M,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_1 | 2018-06-28T16:29:53.155+0000 E STORAGE [initandlisten] WiredTiger error (17) [1530203393:155667][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1530203393:155667][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo_1 | 2018-06-28T16:29:53.157+0000 I STORAGE [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.9
mongo_1 | 2018-06-28T16:29:53.159+0000 E STORAGE [initandlisten] WiredTiger error (1) [1530203393:159333][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1530203393:159333][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo_1 | 2018-06-28T16:29:53.169+0000 E STORAGE [initandlisten] WiredTiger error (17) [1530203393:169598][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1530203393:169598][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo_1 | 2018-06-28T16:29:53.173+0000 I STORAGE [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.10
mongo_1 | 2018-06-28T16:29:53.175+0000 E STORAGE [initandlisten] WiredTiger error (1) [1530203393:175275][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1530203393:175275][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo_1 | 2018-06-28T16:29:53.187+0000 E STORAGE [initandlisten] WiredTiger error (17) [1530203393:187669][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1530203393:187669][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo_1 | 2018-06-28T16:29:53.192+0000 I STORAGE [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.11
mongo_1 | 2018-06-28T16:29:53.194+0000 E STORAGE [initandlisten] WiredTiger error (1) [1530203393:194889][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1530203393:194889][1:0x7f30a240da00], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo_1 | 2018-06-28T16:29:53.197+0000 F STORAGE [initandlisten] Failed to start up WiredTiger under any compatibility version.
mongo_1 | 2018-06-28T16:29:53.197+0000 F STORAGE [initandlisten] 1: Operation not permitted
mongo_1 | 2018-06-28T16:29:53.197+0000 F - [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 194
mongo_1 | 2018-06-28T16:29:53.197+0000 F - [initandlisten]
mongo_1 |
mongo_1 | ***aborting after fassert() failure


Expected behavior:

MongoDB should start.


Reproduce:

Get latest Laradock on Windows and do 'docker-compose up mongo'.


Relevant Code:

Issue seems to be in docker-compose.yml:
${DATA_PATH_HOST}/mongo:/data/db uses path with tilde if you share dev env between Mac and PC developers DATA_PATH_HOST is: DATA_PATH_HOST=~/.laradock/data. This will fail.
My solution was to do MONGO_SAVE_PATH variable that used in MONGO DB part in docker-compose.yml and not have relative path with tilde. Might not be perfect but we are not blocked anymore.

@JimChenWYU
Copy link

+1

@batagliao
Copy link

Jey @jvihrial did you get anywhere with this issue? It seems like a mongodb issue with NTFS. Did you find any solution?

@jvihrial
Copy link
Author

jvihrial commented Oct 11, 2018

@batagliao well, I can post my solution:

diff --git a/docker-compose.yml b/docker-compose.yml
index 91e62b7..36aafb0 100644

--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -387,8 +387,8 @@ services:
       build: ./mongo
       ports:
         - "${MONGODB_PORT}:27017"
-      volumes:
-        - ${DATA_PATH_HOST}/mongo:/data/db
+      volumes:
+        - "/${USER}/${MONGO_SAVE_PATH}:/data/db"
       networks:
         - backend

and in .env:

MONGO_SAVE_PATH=.laradock/data
USER=username-in-host

@mean-cj
Copy link

mean-cj commented Oct 31, 2018

Hello @jvihrial
your solution doesn't work.
please check data on /USER/.laradock/data not have sync.

mongo on windows you can use bind volume.

MongoDB

    mongo:
      build: ./mongo
      ports:
        - "${MONGODB_PORT}:27017"
      volumes:
        - mongodb_data:/data/db
      networks:
        - backend
volumes:
  mongodb_data:
    driver: local

@llioor
Copy link

llioor commented Jan 6, 2019

+1

I have the same error:

2019-01-06T10:55:30.495+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=478M,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-01-06T10:55:30.932+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1546772130:932937][1:0x7f2f220d8a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1546772130:932937][1:0x7f2f220d8a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists
2019-01-06T10:55:30.935+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.9
2019-01-06T10:55:30.936+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1546772130:936439][1:0x7f2f220d8a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1546772130:936439][1:0x7f2f220d8a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo:
      build: ./mongo
      ports:
        - "${MONGODB_PORT}:27017"
      volumes:
        - ${DATA_PATH_HOST}/mongo:/data/db
      networks:
        - backend

@bogardt
Copy link

bogardt commented Feb 5, 2019

+ 1 

I have the same error too:

Logs

/~ -> docker-compose up
Pulling mongo (mongo:4.0.3)...
4.0.3: Pulling from library/mongo
18d680d61657: Pull complete
0addb6fece63: Pull complete
78e58219b215: Pull complete
eb6959a66df2: Pull complete
1bb66a4db707: Pull complete
b18fa018e44b: Pull complete
5d0142bcb0df: Pull complete
db65733de31a: Pull complete
867fe12df2c5: Pull complete
658da3d983f5: Pull complete
fc5dc5157057: Pull complete
d39407c4ddb7: Pull complete
ed6877ef9a9b: Pull complete
Creating mongo ... done
Creating webapi ... done
Attaching to mongo, webapi
mongo     | 2019-02-05T16:37:33.297+0000 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongo     | 2019-02-05T16:37:33.302+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=linuxkit-00155d467d01
mongo     | 2019-02-05T16:37:33.302+0000 I CONTROL  [initandlisten] db version v4.0.3
mongo     | 2019-02-05T16:37:33.302+0000 I CONTROL  [initandlisten] git version: 7ea530946fa7880364d88c8d8b6026bbc9ffa48c
mongo     | 2019-02-05T16:37:33.302+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
mongo     | 2019-02-05T16:37:33.302+0000 I CONTROL  [initandlisten] allocator: tcmalloc
mongo     | 2019-02-05T16:37:33.302+0000 I CONTROL  [initandlisten] modules: none
mongo     | 2019-02-05T16:37:33.303+0000 I CONTROL  [initandlisten] build environment:
mongo     | 2019-02-05T16:37:33.303+0000 I CONTROL  [initandlisten]     distmod: ubuntu1604
mongo     | 2019-02-05T16:37:33.303+0000 I CONTROL  [initandlisten]     distarch: x86_64
mongo     | 2019-02-05T16:37:33.303+0000 I CONTROL  [initandlisten]     target_arch: x86_64
mongo     | 2019-02-05T16:37:33.303+0000 I CONTROL  [initandlisten] options: { net: { bindIpAll: true } }
mongo     | 2019-02-05T16:37:33.312+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=478M,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),
webapi    | standard_init_linux.go:207: exec user process caused "no such file or directory"
mongo     | 2019-02-05T16:37:33.781+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1549384653:781234][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1549384653:781234][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo     | 2019-02-05T16:37:33.791+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1549384653:791945][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1549384653:791945][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo     | 2019-02-05T16:37:33.796+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.1
mongo     | 2019-02-05T16:37:33.798+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1549384653:798800][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1549384653:798800][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo     | 2019-02-05T16:37:33.808+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1549384653:808039][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1549384653:808039][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo     | 2019-02-05T16:37:33.817+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.2
mongo     | 2019-02-05T16:37:33.820+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1549384653:820013][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1549384653:820013][1:0x7fb5688b3a00], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo     | 2019-02-05T16:37:33.821+0000 W STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
mongo     | 2019-02-05T16:37:33.821+0000 F STORAGE  [initandlisten] Reason: 1: Operation not permitted
mongo     | 2019-02-05T16:37:33.821+0000 F -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 645
mongo     | 2019-02-05T16:37:33.821+0000 F -        [initandlisten]
mongo     |
mongo     | ***aborting after fassert() failure
mongo     |
mongo     |
mongo exited with code 14
webapi exited with code 1

Docker-compose

version: "2"
services:
  webapi:
    container_name: webapi
    restart: always
    build: ./
    depends_on:
      - "mongo"
    ports:
      - "4000:4000"
    volumes:
      - ./:/usr/src/webapi
    network_mode: host

  mongo:
    container_name: mongo
    image: mongo:4.0.3
    volumes:
      - ./mongo_data:/data/db
    ports:
      - "27017:27017"
    network_mode: host
 

@jaskiratr
Copy link

I rely on external docker volumes

# (Run once) Create a external named volume for MongoDB
docker volume create mongodbdata

docker-compose.yaml

version: "3"
services:
  database:
    image: mongo
    ports:
      - 27017:27017
    volumes:
      - "mongodbdata:/data/db"
    command: mongod --smallfiles --logpath=/dev/null

volumes:
  mongodbdata:
    external: true

@zongmi
Copy link

zongmi commented Feb 23, 2019

Thank you. I found the same problem as me.
This is my current solution:
Host path
C:\Users\dc125\.laradock\data
Change the. env Mongo configuration

DATA_PATH_HOST=~/.laradock/data 
#Change to
DATA_PATH_HOST=/Users/dc125/.laradock/data

Then start Mongo.
It may not be a good way, but it solved my problem.

@Boltmerz
Copy link

Boltmerz commented Feb 27, 2019

Hi all, Im having the same problem.
The .env folder value is
MONGO_SAVE_PATH=./database/db

The DB docker file:
FROM mongo:latest
VOLUME ["/data/db"]
WORKDIR /data
EXPOSE 27017
CMD ["mongod"]

The docker-compose.yml
build: ./database
ports:
- 32815:27017
volumes:
- ./database/db:/data/db

@johanes
Copy link

johanes commented Dec 17, 2019

Found a solution here strapi/strapi-docker#80 (comment)

@stale
Copy link

stale bot commented Mar 16, 2020

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Mar 16, 2020
@stale
Copy link

stale bot commented Apr 6, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Apr 6, 2020
@stale
Copy link

stale bot commented Apr 27, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

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

No branches or pull requests