Unifi controller image update causes factory reset

I’m running Linuxserver/unifi-controller:latest on a Synology DS718+ NAS, container was created through the Synology GUI. Everything works great until I update the Docker image, then the container reverts to factory defaults and I have to restore from backup. I cannot figure out why.

I use all of the image defaults, except that I mount /config to a NAS directory (which should retain settings between updates, but doesn’t seem to) and mounting the Unifi Backup directory to a NAS folder as well. I also open up port 3478 because I get inform errors if I don’t and I changed the timezone.

I used this command to get the full Docker command for the running image: https://stackoverflow.com/a/60393380

docker run
–name=unifi-controller
–hostname=unifi-controller
–mac-address=02:42:ac:11:00:03
–env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
–env=HOME=/root
–env=LANGUAGE=en_US.UTF-8
–env=LANG=en_US.UTF-8
–env=TERM=xterm
–env=TZ=America/Toronto
–volume=/volume1/backup/unifi:/usr/lib/unifi/data/backup:rw
–volume=/volume1/docker/unifi:/config:rw
–volume=/config
–network=bridge
–workdir=/usr/lib/unifi
-p 0.0.0.0:3478:3478/udp
-p 0.0.0.0:8080:8080
-p 0.0.0.0:8443:8443
-p 0.0.0.0:8843:8843
-p 0.0.0.0:8880:8880
–restart=always
–label=‘maintainer=aptalca’
–label=‘build_version=Linuxserver.io version:- 6.0.41-ls90 Build-date:- 2020-12-16T22:45:14+00:00’
–log-driver=db
–detach=true
-t linuxserver/unifi-controller:latest

I also see these entries in the Unifi log as the container is starting after an image update:

[2020-12-21T10:33:57,328] INFO db - waiting for db connection…
[2020-12-21T10:33:59,330] INFO db - Connecting to mongodb://localhost:27117
[2020-12-21T10:34:03,576] INFO db - setting mongodb features compatibility version to 3.6
[2020-12-21T10:34:03,620] INFO db - *** Factory Default *** Database exists. Clean it
[2020-12-21T10:34:05,262] INFO db - Connecting to mongodb://localhost:27117
[2020-12-21T10:34:05,278] INFO stat - *** Factory Default *** Stat Database exists. Clean it

Any thoughts?

Thanks,

Kevin

There is an extra volume mapping for /config in there, which is probably overriding your other one

I wondered about that but I’m not adding the one that’s only /config. Is it in the image config, can I override it?

I also see data, logs and run directories in the /docker/unifi directory on the NAS.
image