Workaround: Unifi-Controller MongoDB crash on startup with Signal 7 (Bus Error)

I’m opening a new ticket based on a previous post by @j0nnymoe, as that one is closed and I can’t access it any longer.

I’m currently running arm64 on RPI 4, and was having similar issues. After some digging, I found that armhf image was not working properly, but if I specifically targeted the aarch64 version things worked ok. However, there is another snag that was causing arm64 containers to fail on the docker side. Here’s an open an issue #41092 on the Moby repo (sorry, can’t post links because of new user restrictions) about a real fix, with a semi-confusing workaround in the comments.

My steps were:

  1. Copy the seccomp profile locally from https://github.com/docker/docker-ce/blob/master/components/engine/profiles/seccomp/default.json
  2. Replace the ‘archMap’ key with "architectures": [ "SCMP_ARCH_AARCH64", "SCMP_ARCH_ARM" ]
  3. Pass in --security-opt seccomp=<path_to>/seccomp.json when running the container.

You should be able to verify this is working by running the following command and checking the mongodb logs.

sudo docker run -it --security-opt seccomp=<path_to>/seccomp.json linuxserver/unifi-controller:arm64v8-6.0.28-ls84 /bin/bash

Hope this helps someone.

p.s. I’m not sure exactly why mongo was failing. Mongo was also failing on the host with various options I tried including the raspian package, and the one from mongodb-org. Maybe it has something to do with unaligned memory access? Found similar things on stackoverflow but didn’t want to go down the road of compiling on my own and rolling my own unifi-controller dockerfile.

previous topic: Unifi-Controller MongoDB crash on startup with Signal 7 (Bus Error)

moby link: https://github.com/moby/moby/issues/41092