jacobalberty / unifi-docker

Unifi Docker files
MIT License
2.14k stars 454 forks source link

docker on QNAP NAS won't start if volume is bound externally #749

Closed cr4nkbrother closed 2 months ago

cr4nkbrother commented 3 months ago

Operating system

QTS 5.1.7

UniFi Tag

latest

Docker run

docker run --name=unifi-run-test --dns=192.168.0.1 --dns=1.1.1.1 --network=qnet-static-eth0-0fa2ce --workdir=/unifi --restart=always -v /unifi/config:/unifi -v /unifi/usr:/usr/lib/unifi jacobalberty/unifi:latest

Bug description

When I try to mount the config folders for the container on my qnap to be able to update or backup the controller won't start.

The docker compose File was build like this:

`version: "3.4" networks: qnet-static-eth0-0fa2ce: external: name: qnet-static-eth0-0fa2ce

services:

unifi-controller-test: networks: qnet-static-eth0-0fa2ce: ipv4_address: 192.168.0.200 image: jacobalberty/unifi:latest restart: always volumes:

alternatively tried with docker run: docker run --name=unifi-run-test --dns=192.168.0.1 --dns=1.1.1.1 --network=qnet-static-eth0-0fa2ce --workdir=/unifi --restart=always -v /unifi/config:/unifi -v /unifi/usr:/usr/lib/unifi jacobalberty/unifi:latest

The container will be created, but the logs will only output: [2024-06-11 17:52:59,693] Starting unifi controller service. [2024-06-11 17:52:59,696] WARNING: Running UniFi in insecure (root) mode Error: Unable to access jarfile /usr/lib/unifi/lib/ace.jar [2024-06-11 17:52:59,703] WARN: unifi service process ended without being signaled? Check for errors in /unifi/log.

The /unifi/log (or /unifi/config/log) folder is created but empty.

If I omit the mounted volumes the controller is created without a problem.

I've tried installing a controller without mounts and copying the content of the usr folder to the Mounted one. Then the container will start and load correctly.

Steps to reproduce

No response

Relevant log output

No response

rajiv commented 3 months ago

The error Unable to access jarfile /usr/lib/unifi/lib/ace.jar indicates that you should not be mounting this directory at all. Try removing -v /unifi/usr:/usr/lib/unifi.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.