1

I have multiple images that I want to start from a docker-compose file. Most of them work properly but the MongoDB one keeps failing on build. It has to be a set-up problem as the same code is running just fine on other computers.

I've tried to adjust the docker settings (Resources and FileSharing) but that didn't seem to help. I've also deleted all the Images and recloned them, still no success.

My docker-compose file:

version: "3.1"

services:
  resultdataprovider:
    build:
      context: ./datastorage/resultDataProvider
      dockerfile: dev.Dockerfile
    container_name: resultdataprovider
    volumes:
      - ./datastorage/resultDataProvider:/usr/src/app/code
    environment:
      REDIS_URI: "redis"
      MONGO_URI: ${MONGO_URI}
      MONGO_CLIENT_RESULT: ${MONGO_CLIENT_RESULT}
    ports:
      - '3200:3000'
    depends_on:
      - "redis"
      - "mongo"


  webclient:
    build:
      context: ./frontend/webclient
      dockerfile: dev.Dockerfile
    container_name: webclient
    volumes:
      - ./frontend/webclient/src:/usr/src/app/src
    environment:
      BACKEND_URI: "http://webapi:3000/api/ql"
    ports:
      - "8080:3000"


  webapi:
    build:
      context: ./frontend/webapi
      dockerfile: dev.Dockerfile
    container_name: webapi
    volumes:
      - ./frontend/webapi:/usr/src/app/code
    environment:
      REDIS_URI: "redis"
      MONGO_URI: ${MONGO_URI}
      CHATMANAGER_URI: "http://chatmanager:3000"
    ports:
      - "3300:3000"
    depends_on:
      - "redis"
      - "mongo"


  chatmanager:
    build:
      context: ./core/chatManager
      dockerfile: dev.Dockerfile
    container_name: chatmanager
    volumes:
      - ./core/chatManager:/usr/src/app/code
    environment:
      REDIS_URI: "redis"
      MONGO_URI: ${MONGO_URI}
      MONGO_CLIENT_CHAT: ${MONGO_CLIENT_CHAT}
    ports:
      - "3400:3000"
    depends_on:
      - "redis"
      - "mongo"


  workertemplatejs:
    build:
      context: ./workers/templateJS
      dockerfile: dev.Dockerfile
    container_name: workertemplatejs
    environment:
      REDIS_URI: "redis"
      MONGO_URI: ${MONGO_URI}
    volumes:
      - ./workers/templateJS:/usr/src/app/code
    ports:
      - "3500:3000"
    depends_on:
      - "redis"
      - "mongo"


  workertemplatepy:
    build:
      context: ./workers/templatePy
      dockerfile: Dockerfile
    container_name: workertemplatepy
    environment:
      REDIS_URI: 'redis'
      MONGO_URI: ${MONGO_URI}
    ports:
      - '5000:5000'
    depends_on:
      - 'redis'
      - 'mongo'


  redis:
    image: redis
    container_name: redis
    ports:
      - "6379:6379"


  mongo:
    image: mongo:latest
    container_name: "mongo"

    environment:
      - MONGO_DATA_DIR=/data/db
      - MONGO_LOG_DIR=/dev/null
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=example
    ports:
      - "27017:27017"
    volumes:
      - ./data/db:/data/db

This is the error that appears in the console. Would be great if someone could help me out.

mongo                   | 2020-06-16T07:00:25.784+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.37
mongo                   | 2020-06-16T07:00:25.790+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1592290825:790954][1:0x7f3658c2eb00], connection: __posix_open_file,
667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1592290825:790954][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo                   | 2020-06-16T07:00:25.874+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1592290825:873979][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1592290825:873979][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo                   | 2020-06-16T07:00:25.883+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.38
mongo                   | 2020-06-16T07:00:25.891+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1592290825:889926][1:0x7f3658c2eb00], connection: __posix_open_file,
667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1592290825:889926][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo                   | 2020-06-16T07:00:25.968+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1592290825:968527][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1592290825:968527][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo                   | 2020-06-16T07:00:25.977+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.39
mongo                   | 2020-06-16T07:00:25.985+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1592290825:985160][1:0x7f3658c2eb00], connection: __posix_open_file,
667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1592290825:985160][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo                   | 2020-06-16T07:00:26.073+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1592290826:73678][1:0x7f3658c2eb00], connection: __posix_open_file,
667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1592290826:73678][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo                   | 2020-06-16T07:00:26.086+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.40
mongo                   | 2020-06-16T07:00:26.092+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1592290826:92350][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1592290826:92350][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt:
handle-open: open: Operation not permitted
mongo                   | 2020-06-16T07:00:26.164+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1592290826:164150][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1592290826:164150][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo                   | 2020-06-16T07:00:26.181+0000 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.41
mongo                   | 2020-06-16T07:00:26.193+0000 E  STORAGE  [initandlisten] WiredTiger error (1) [1592290826:193674][1:0x7f3658c2eb00], connection: __posix_open_file,
667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1592290826:193674][1:0x7f3658c2eb00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongo                   | 2020-06-16T07:00:26.205+0000 W  STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
mongo                   | 2020-06-16T07:00:26.207+0000 F  STORAGE  [initandlisten] Reason: 1: Operation not permitted
mongo                   | 2020-06-16T07:00:26.208+0000 F  -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 915
mongo                   | 2020-06-16T07:00:26.210+0000 F  -        [initandlisten]
mongo                   |
mongo                   | ***aborting after fassert() failure
mongo                   |
mongo                   |
mongo exited with code 14

Thanks a lot!

BaRts2525
  • 11
  • 2
  • 1
    Hi and welcome to SO. Hard to tell for sure since you are not giving a single info on how you actually configure and start your container... but as a guess: you are bind mounting a data volume from your host to the container and the user inside the container does not have the correct privileges to read and/or write files in there. – Zeitounator Jun 16 '20 at 07:17
  • most probably your /data/db needs more permission. – Nafeo Alam Jun 16 '20 at 07:27

0 Answers0