exit code 14 error in mongodb container, I'm using mongodb container with with volume path then received exit code 14 error
Asked Answered
P

7

16
version: "3"
services:
   mongo:
      image: mongo
      working_dir: /c/data/
      ports:
       - 27017:27017
      deploy:
        replicas: 1
      volumes:
        - /c/data/:/data/db

I am tried that above stack file and I'm receiving exit code 14 error please give me the solution about the error,

Petiole answered 22/9, 2020 at 6:27 Comment(1)
working_dir refers to a directory inside the container, not on the host. you need to make sure /c/data/ can be created on the node where the container runs (it is quite a weird path...). It is generally better to avoid using host volumes when working with stacks.Stewart
N
12

Delete everything from /c/data/, in case there are some data from older version of Mongo

Naman answered 29/10, 2020 at 16:19 Comment(4)
Yes, it is work but do I have to delete it every time? If I delete everything from /c/data/ then it's work so I start the db and the files are recreated. When I restart the db I get exit code 14 error.Chamonix
I guess so.. only in case of upgrade/downgrade's.. I didn't found any workarounds at the momentNaman
This worked for me, along with using the -d flag.Berghoff
If I was ok with deleting data, then why would I make shared volume?Widener
A
10

In your terminal:

docker system prune

Works for me. Kew Approves =)

*Please, be careful! it clears everything!!

Accomplished answered 9/11, 2021 at 18:31 Comment(2)
works, it will clear the messGaylagayle
This helped me quickly resolve a disk full issue today. But i would advise that you proceed with care, and perhaps by pruning containers without touching your volumes.Riband
C
2

It depends how you get up the service, for example use:

docker-compose up -d (on Windows)

instead of docker-compose up. In this way you have the control on terminal to call docker-compose down and the MongoDB process can terminate correctly.

Chamonix answered 9/12, 2020 at 10:28 Comment(2)
This worked for me, but I also had the issue of old data files that I had to delete.Berghoff
You can issue docker-compose down even if you started it wiithout -d -- in another terminal window.Widener
S
1

On a Mac, you might be able to resolve the issue by deleting the /Users/{your account}/data folder.

You should be able to find the folder by going to Finder -> Go -> Go to Folder -> And search ~/Users/.

Other solutions that I tried before this that didn't work:

  • stopping and removing all mongo containers
  • removing all mongo images
  • Clean / Purge data from Docker Desktop
  • uninstall and reinstall Docker
Selfhelp answered 10/10, 2021 at 18:31 Comment(0)
W
1

For me what helped is deleting the mounted host directory, deleting the volume with docker volume rm {CONTAINER NAME\ID}. Make sure to write the volume in compose right, for example:

  ...

  database:
    container_name: database
    image: mongo
    ports:
      - '27017:27017'
    volumes:
      - db:/data/db  
  ...  
  volumes: 
    db:  

Wilmott answered 3/9, 2022 at 18:19 Comment(0)
A
0
  1. Install WSL2 ( It requires recent windows update)
  2. Docker -> Settings -> Enable-> Use WSL 2 based engine
Anticlerical answered 2/12, 2021 at 10:29 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewWilkey
L
0

This might be caused by full disk, causing data/ -dir corruption. It's a good idea to have a backup, and restore the data to a clean installation from there.

Liftoff answered 15/2 at 6:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.