docker-library/mongo

MongoDB 6.0 exited with code 48

neumann-nico opened this issue · 1 comments

I previously used MongoDB 4.4 with the following docker-compose file taken from here: https://stackoverflow.com/a/66069362

Now I recently upgraded to MongoDB 6.0 and sometimes I get the error exited with code 48

docker-compose.yaml

version: '3'
services:
  mongodb:
    image: mongo:6.0
    container_name: local_mongodb
    ports:
      - "27017:27017"
    volumes:
      - ./mongorestore.sh:/docker-entrypoint-initdb.d/mongorestore.sh
      - ./db-dump:/db-dump

mongorestore.sh

mongorestore /db-dump

Logs
log.txt

We habe around 100 CI runs per day (AWS t3 instances) where it crashes around once per day.
This also happens locally on multiple machines (Linux x64 and MacOS arm64) but not that often. So not that easy to reproduce unfortunately.
It doesn't matter if there is something to restore or not.
Is this some kind of race condition?

From what I can find online, this typically means the port is already in use, which is weird inside a container but maybe something is happening with how the port is shared or how the container is run? 😕 🤔