UniFi-Video-Controller
UniFi-Video-Controller copied to clipboard
Service exit with a return value of 4
docker image: pducharme/unifi-video-controller:latest
trying to start up the docker container with debug enabled and it ends with:
set_caps(CAPS) failed for user 'unifi-video' Service exit with a return value of 4
Here is the entire log:
| Java VM Config.: "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jvm.cfg" | Found JVMs: 1 | JVM Name: "server" | "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so" +------------------------------------------------------- Using default JVM in /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so Invoking w/ LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64 +-- DUMPING PARSED COMMAND LINE ARGUMENTS -------------- | Detach: True | Show Version: No | Show Help: No | Check Only: Disabled | Stop: False | Wait: 0 | Run as service: No | Install service: No | Remove service: No | JVM Name: "null" | Java Home: "/usr/lib/jvm/java-8-openjdk-amd64/jre" | PID File: "/var/run/unifi-video/unifi-video.pid" | User Name: "unifi-video" | Extra Options: 17 | "-Djava.class.path=/usr/share/java/commons-daemon.jar:/usr/lib/unifi-video/lib/airvision.jar" | "-Dav.tempdir=/var/cache/unifi-video" | "-Djava.security.egd=file:/dev/./urandom" | "-Xmx1899M" | "-Xss512K" | "-XX:+UseG1GC" | "-XX:+UseStringDeduplication" | "-XX:MaxMetaspaceSize=1024M" | "-Djava.library.path=/usr/lib/unifi-video/lib" | "-Djava.awt.headless=true" | "-Djavax.net.ssl.trustStore=/usr/lib/unifi-video/data/ufv-truststore" | "-Dfile.encoding=UTF-8" | "-Dcom.sun.management.jmxremote" | "-Dcom.sun.management.jmxremote.ssl=false" | "-Dcom.sun.management.jmxremote.authenticate=false" | "-Dcom.sun.management.jmxremote.port=7654" | "-Djava.rmi.server.hostname=172.20.0.10" | Class Invoked: "com.ubnt.airvision.Main" | Class Arguments: 1 | "start" +------------------------------------------------------- user changed to 'unifi-video' User 'unifi-video' validated Attempting to locate Java Home in /usr/lib/jvm/java-8-openjdk-amd64/jre Attempting to locate VM configuration file /usr/lib/jvm/java-8-openjdk-amd64/jre/jre/lib/jvm.cfg Attempting to locate VM configuration file /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jvm.cfg Attempting to locate VM configuration file /usr/lib/jvm/java-8-openjdk-amd64/jre/jre/lib/amd64/jvm.cfg Attempting to locate VM configuration file /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jvm.cfg Found VM configuration file at /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jvm.cfg Found VM server definition in configuration Checking library /usr/lib/jvm/java-8-openjdk-amd64/jre/jre/lib/amd64/server/libjvm.so Checking library /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so Found VM client definition in configuration Checking library /usr/lib/jvm/java-8-openjdk-amd64/jre/jre/lib/amd64/client/libjvm.so Checking library /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/client/libjvm.so Cannot locate library for VM client (skipping) Found VM zero definition in configuration Checking library /usr/lib/jvm/java-8-openjdk-amd64/jre/jre/lib/amd64/zero/libjvm.so Checking library /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/zero/libjvm.so Cannot locate library for VM zero (skipping) Found VM dcevm definition in configuration Checking library /usr/lib/jvm/java-8-openjdk-amd64/jre/jre/lib/amd64/dcevm/libjvm.so Checking library /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/dcevm/libjvm.so Cannot locate library for VM dcevm (skipping) Java Home located in /usr/lib/jvm/java-8-openjdk-amd64/jre +-- DUMPING JAVA HOME STRUCTURE ------------------------ | Java Home: "/usr/lib/jvm/java-8-openjdk-amd64/jre" | Java VM Config.: "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/jvm.cfg" | Found JVMs: 1 | JVM Name: "server" | "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so" +------------------------------------------------------- Running w/ LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64 redirecting stdout to /dev/null and stderr to /dev/null Switching umask back to 660 from 077 done. Attemtping to load library /lib64/libcap.so.2 Attemtping to load library /lib64/libcap.so.1 Attemtping to load library /lib64/libcap.so Attemtping to load library /usr/lib64/libcap.so.2 Attemtping to load library /usr/lib64/libcap.so.1 Attemtping to load library /usr/lib64/libcap.so Attemtping to load library /lib/libcap.so.2 Attemtping to load library /lib/libcap.so.1 Attemtping to load library /lib/libcap.so Attemtping to load library /usr/lib/libcap.so.2 Attemtping to load library /usr/lib/libcap.so.1 Attemtping to load library /usr/lib/libcap.so Attemtping to load library libcap.so.2 loaded cap_free from libcap. loaded cap_init from libcap. loaded cap_clear from libcap. loaded cap_get_flag from libcap. loaded cap_set_flag from libcap. loaded cap_set_proc from libcap. failed setting default capabilities. set_caps(CAPS) failed for user 'unifi-video' Service exit with a return value of 4
I can't get to the setup wizard but the container starts obviously. Does anyone know what is wrong and how I can go about fixing it?
Do you have SYS_ADMIN and DAC_READ_SEARCH enabled for the container? In my docker-compose file I have
cap_add:
- SYS_ADMIN
- DAC_READ_SEARCH
The Kubernetes version is
securityContext:
capabilities:
add: [“SYS_ADMIN”, "DAC_READ_SEARCH"]
thanks, that got me past the error. still can't hit the site. I only opened up the ports that ubiquiti recommends. The other ports in the yaml file, would they all be needed? I did, 10002 (mapped to 10001 since its already in use by unifi controller - might run into issues there), 7080, 7443, 7445-7447
noticed I"m getting another error, but for the mongodb logger I assume:
Java VM created successfully Class org/apache/commons/daemon/support/DaemonLoader found Native methods registered java_init done Daemon loading... 2021-12-29 13:44:29.745661 Waiting for mongodb to come online.....2021-12-29 13:44:34,339 ERROR Unable to locate appender ConsoleAppender for logger Daemon loaded successfully java_load done dropped capabilities. Daemon started successfully java_start done Waiting for a signal to be delivered create_tmp_file: /tmp/81.jsvc_up
Here's my full docker-compose section, looks like I've got a few more ports open.
unifi-video:
networks:
- default
restart: unless-stopped
#image: pducharme/unifi-video-controller
image: paulcarlucci/unifi-video-controller:3.10.13-log4j-2.16.0
ports:
- "10001:10001"
- "1935:1935"
- "6666:6666"
- "7080:7080"
- "7442:7442"
- "7443:7443"
- "7444:7444"
- "7445:7445"
- "7446:7446"
- "7447:7447"
volumes:
- /var/lib/unifi-video:/var/lib/unifi-video
- /apps/opt/unifi-video/videos:/var/lib/unifi-video/videos
cap_add:
- SYS_ADMIN
- DAC_READ_SEARCH
environment:
- PUID=1003
- PGID=1003
- DEBUG=1
For that matter since you mentioned Unifi controller on port 10001, I'm using that as well on the same system, but I don't have a conflict with 10001 since controller uses UDP instead. Here's my controller entry
unifi:
# networks:
# - default
image: jacobalberty/unifi:latest
# image: tchellomello/unifi:latest
restart: unless-stopped
volumes:
- /var/lib/unifi/data:/unifi/data
- /var/lib/unifi/log:/unifi/log
- /var/lib/unifi/cert:/unifi/cert
- /var/lib/unifi/init:/unifi/init.d
environment:
- TZ="US/Eastern"
- RUNAS_UID0=false
- UNIFI_UID=1004
- UNIFI_GID=1004
ports:
- "6789:6789"
- "8080:8080"
- "8443:8443"
- "3478:3478/udp"
- "10001:10001/udp"
"ERROR Unable to locate appender" is expected and can be ignored.
Java VM created successfully
Class org/apache/commons/daemon/support/DaemonLoader found
Native methods registered
java_init done
Daemon loading...
2021-12-18 16:18:05.443663 Waiting for mongodb to come online...2021-12-18 16:18:07,661 main ERROR Unable to locate appender "ConsoleAppender" for logger config "root"
Daemon loaded successfully
java_load done
dropped capabilities.
.......... done.
thanks for your replies.
I was trying to get this to run by creating a container in portainer, but the website just wouldn't show, not sure what I was doing wrong. scapped that plan and used the .yml file and all is good by creating a stack in portainer.
also, thx for pointing me to a image with the log4j fix!