mongoDB Docker crashing/terminating after a while (got signal 15 (Terminated))

Hi, I created a new docker compose file for my unifi controller after linuxserver.io changed their docker image to not include mongodb.

But the mongodb always crashes after a while.

I have tested mongodb version 3.6 to 4.0, all with the same result.
Version >4.0 seems to need armv8.2.

Host:
Platform: Raspberry Pi 4
OS: Ubuntu 23.10 aarch64 (armv8)
Kernel: 6.5.0-1005-raspi
RAM: 4GB
Docker: 24.0.6, build ed223bc

docker-compose.yml:

version: "3.8"

services:
  app:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi_app
    hostname: unifi_app
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /docker/unifi_stack/app/conf:/config:rw
    networks:
      macvlan_lan:
        ipv4_address: 10.1.1.1
      backend:
    environment:
      - PUID=1000
      - PGID=1000
      - MONGO_USER=unifi
      - MONGO_PASS=foobar
      - MONGO_HOST=unifi_db
      - MONGO_PORT=27017
      - MONGO_DBNAME=unifi

  db:
    image: mongo:3.6
    container_name: unifi_db
    hostname: unifi_db
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /docker/unifi_stack/db/data:/data/db
      - /docker/unifi_stack/db/conf/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    networks:
      backend:

networks:
  backend:

init-mongo.js:

db.getSiblingDB(“unifi”).createUser({user: “unifi”, pwd: “foobar”, roles: [{role: “dbOwner”, db: “unifi”}, {role: “dbOwner”, db: “unifi_stat”}]});

Log:

2023-10-20T16:29:36.757+0200 I NETWORK  [initandlisten] waiting for connections on port 27017
2023-10-20T16:29:46.865+0200 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2023-10-20T16:29:46.866+0200 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
2023-10-20T16:29:46.866+0200 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2023-10-20T16:29:46.866+0200 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
2023-10-20T16:29:46.871+0200 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
2023-10-20T16:29:47.018+0200 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
2023-10-20T16:29:47.018+0200 I CONTROL  [signalProcessingThread] now exiting
2023-10-20T16:29:47.019+0200 I CONTROL  [signalProcessingThread] shutting down with code:0

Something is killing mongod. I would look at docker first, its logs and journalctl.

mongod is just doing what it is told, to shut down.

what is signal 15 in linux?

As an alternative to running MongoDB 3.x/4.x, if you want to run against a modern version of MongoDB on the Pi, see here.

1 Like

The error occurs at irregular intervals.
In the beginning, when I initialized the Unifi controller, the error occurred more frequently, but now it takes days to occur.
It takes me a while to notice it, and then unfortunately I can’t find anything in the logs.

I don’t understand why such a signal comes. The load is not high and all other containers do not have such problems.

@Matt_Kneiser
The Unifi controller only supports MongoDB up to 4.4.
It has been reported that newer versions will work, but it is not officially supported.

Considering that MongoDB does not officially support any version on the Raspberry Pi platform at the moment, you are operating in uncharted territory. You’re pushing your luck no matter what you try :slight_smile:

But MongoDB officially supports Docker and arm64?

Or is that not the official DockerHub repo of MongoDB?
https://hub.docker.com/r/mongodb/mongodb-community-server

It feels like the old days when Doom only ran with certain hardware components.

I know that MongoDB >4.0 requires additional command extensions that the arm64 processor of the raspberryPi 4 does not support.
This also tells me the MongoDB 4.4 container as soon as I try to start it.
Is there an official list so you can at least select your hardware for command extensions.

The only information I have found is here:

I wasn’t fully correct because MongoDB 4.4 isn’t end of life (EOL) yet. It will fall into EOL this upcoming February. MongoDB 5.0+ places microarchitecture requirements that exceed what’s on the Pi 4.