UniFi Network Application stuck at starting up

I’ve been using the Unifi controller for years in a dedicated VM. I’m trying to move as much as I can over to Docker. When I try to navigate to the web page, I’m greeted with
UniFi Network Application is starting up... Please wait a moment
In the Docker logs I’m seeing java related errors.

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1773)

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)

	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325)

	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)

	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323)

	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)

	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:959)

	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)

	at com.ubnt.service.class.Object(Unknown Source)

	at com.ubnt.service.C.intsuper(Unknown Source)

	at com.ubnt.net.SpringConfig.onStartup(Unknown Source)

	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)

	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4866)

	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)

	... 5 more

Caused by: java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "Jd"

	at java.base/java.net.URLDecoder.decode(URLDecoder.java:237)

	at java.base/java.net.URLDecoder.decode(URLDecoder.java:147)

	at com.mongodb.ConnectionString.urldecode(ConnectionString.java:1239)

	at com.mongodb.ConnectionString.<init>(ConnectionString.java:387)

	at com.mongodb.ConnectionString.<init>(ConnectionString.java:321)

	at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:258)

	at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:240)

	at com.ubnt.service.db.oOOO.interface(Unknown Source)

	at com.ubnt.service.db.oOOO.class(Unknown Source)

	at com.ubnt.service.db.oOOO.ö00000(Unknown Source)

	at com.ubnt.service.db.oOOO.Ø00000(Unknown Source)

	at com.ubnt.service.db.oooO.null(Unknown Source)

	at com.ubnt.service.db.oooO.Ö00000(Unknown Source)

	at com.ubnt.service.db.oooO.Óo0000(Unknown Source)

	at com.ubnt.service.db.oooO.afterPropertiesSet(Unknown Source)

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1820)

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1769)

How do I get this working?

Share your compose and full container logs
Note: we do not support deploying containers from any ui with the unfortunate exception of unraid. If you’re using unraid, provide the docker run

I’m running on a Debian 12 VM hosted on xcp-ng. Here is the compose file and I will figure out how to get the full container logs and post them.

---
services:
  unifi-db:
    image: docker.io/mongo:5.0
    container_name: unifi-db
    volumes:
      - /var/lib/docker/volumes/mongodb/_data:/data/db
      - /var/lib/docker/volumes/mongodb/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    restart: unless-stopped
  unifi-network-application:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi-network-application
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MONGO_USER=$MONGO_USER
      - MONGO_PASS=$MONGO_PASS
      - MONGO_HOST=unifi-db
      - MONGO_PORT=27017
      - MONGO_DBNAME=$MONGO_DBNAME
      - MEM_LIMIT=1024 #optional
      - MEM_STARTUP=1024 #optional
      - MONGO_TLS= #optional
      - MONGO_AUTHSOURCE= #optional
    volumes:
      - /var/lib/docker/volumes/Unifi/_data:/config
    ports:
      - 8443:8443
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 1900:1900/udp #optional
      - 8843:8843 #optional
      - 8880:8880 #optional
      - 6789:6789 #optional
      - 5514:5514/udp #optional
    restart: unless-stopped

Portainer give me this file when I hit download logs. Is there anything more I should be looking for? I don’t see an option to attach a file, so here it is.

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

[custom-init] No custom files found, skipping...
Exception in thread "launcher" com.ubnt.net.new: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
	at com.ubnt.net.C.ÒÒ0000(Unknown Source)
	at com.ubnt.net.C.Stringnew(Unknown Source)
	at com.ubnt.service.C.OÔ0000(Unknown Source)
	at com.ubnt.ace.Launcher.Ô00000(Unknown Source)
	at com.ubnt.ace.Launcher.main(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
	at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:186)
	... 5 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoRuntimeService' defined in com.ubnt.service.db.CoreDatabaseSpringContext: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "Jd"
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1773)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:959)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
	at com.ubnt.service.class.Object(Unknown Source)
	at com.ubnt.service.C.intsuper(Unknown Source)
	at com.ubnt.net.SpringConfig.onStartup(Unknown Source)
	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4866)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	... 5 more
Caused by: java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "Jd"
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:237)
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:147)
	at com.mongodb.ConnectionString.urldecode(ConnectionString.java:1239)
	at com.mongodb.ConnectionString.<init>(ConnectionString.java:387)
	at com.mongodb.ConnectionString.<init>(ConnectionString.java:321)
	at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:258)
	at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:240)
	at com.ubnt.service.db.oOOO.interface(Unknown Source)
	at com.ubnt.service.db.oOOO.class(Unknown Source)
	at com.ubnt.service.db.oOOO.ö00000(Unknown Source)
	at com.ubnt.service.db.oOOO.Ø00000(Unknown Source)
	at com.ubnt.service.db.oooO.null(Unknown Source)
	at com.ubnt.service.db.oooO.Ö00000(Unknown Source)
	at com.ubnt.service.db.oooO.Óo0000(Unknown Source)
	at com.ubnt.service.db.oooO.afterPropertiesSet(Unknown Source)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1820)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1769)
	... 20 more
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

[custom-init] No custom files found, skipping...
Exception in thread "launcher" com.ubnt.net.new: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
	at com.ubnt.net.C.ÒÒ0000(Unknown Source)
	at com.ubnt.net.C.Stringnew(Unknown Source)
	at com.ubnt.service.C.OÔ0000(Unknown Source)
	at com.ubnt.ace.Launcher.Ô00000(Unknown Source)
	at com.ubnt.ace.Launcher.main(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
	at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:186)
	... 5 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoRuntimeService' defined in com.ubnt.service.db.CoreDatabaseSpringContext: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "Jd"
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1773)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:959)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
	at com.ubnt.service.class.Object(Unknown Source)
	at com.ubnt.service.C.intsuper(Unknown Source)
	at com.ubnt.net.SpringConfig.onStartup(Unknown Source)
	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4866)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	... 5 more
Caused by: java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "Jd"
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:237)
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:147)
	at com.mongodb.ConnectionString.urldecode(ConnectionString.java:1239)
	at com.mongodb.ConnectionString.<init>(ConnectionString.java:387)
	at com.mongodb.ConnectionString.<init>(ConnectionString.java:321)
	at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:258)
	at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:240)
	at com.ubnt.service.db.oOOO.interface(Unknown Source)
	at com.ubnt.service.db.oOOO.class(Unknown Source)
	at com.ubnt.service.db.oOOO.ö00000(Unknown Source)
	at com.ubnt.service.db.oOOO.Ø00000(Unknown Source)
	at com.ubnt.service.db.oooO.null(Unknown Source)
	at com.ubnt.service.db.oooO.Ö00000(Unknown Source)
	at com.ubnt.service.db.oooO.Óo0000(Unknown Source)
	at com.ubnt.service.db.oooO.afterPropertiesSet(Unknown Source)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1820)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1769)
	... 20 more

Our readme for the container says how to get the container logs. As initially mentioned, we do not support or recommend deploying or containers with portainer. Are you able to recreate the issue when deploying in a supported manner with a new folder?

Also, what is your cpu

I read that backwards and thought it was unraid that you don’t support. I’ll work on doing it from the command line. I see a mention of real time logs, but don’t see any mention of historical log files. Yesterday I was running on a Ryzen 7 3700x. I upgraded that to a 5700G, not that it seems to make any difference.

you should be good, i asked because we are seeing a lot of apps no longer support 15+ yr old cpus.

Just restart the container, grab the logs like the readme says, you’ll know the start is there as it’ll have our ascii logo.

Behavior seems to be identical using the command line.

$ docker logs -f unifi-network-application
[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

[custom-init] No custom files found, skipping...
Exception in thread "launcher" com.ubnt.net.ooOO: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
	at com.ubnt.net.new.ÒÒ0000(Unknown Source)
	at com.ubnt.net.new.ÔÒ0000(Unknown Source)
	at com.ubnt.service.C.OÔ0000(Unknown Source)
	at com.ubnt.ace.Launcher.Ô00000(Unknown Source)
	at com.ubnt.ace.Launcher.main(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
	at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:186)
	... 5 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoRuntimeService' defined in com.ubnt.service.db.CoreDatabaseSpringContext: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "Jd"
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:959)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
	at com.ubnt.service.return.Object(Unknown Source)
	at com.ubnt.service.C.Óo0000(Unknown Source)
	at com.ubnt.net.SpringConfig.onStartup(Unknown Source)
	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4866)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	... 5 more
Caused by: java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "Jd"
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:237)
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:147)
	at com.mongodb.ConnectionString.urldecode(ConnectionString.java:1239)
	at com.mongodb.ConnectionString.<init>(ConnectionString.java:387)
	at com.mongodb.ConnectionString.<init>(ConnectionString.java:321)
	at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:258)
	at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:240)
	at com.ubnt.service.db.A.ÕO0000(Unknown Source)
	at com.ubnt.service.db.A.Õ00000(Unknown Source)
	at com.ubnt.service.db.A.if(Unknown Source)
	at com.ubnt.service.db.A.Ø00000(Unknown Source)
	at com.ubnt.service.db.oooO.ô00000(Unknown Source)
	at com.ubnt.service.db.oooO.Ö00000(Unknown Source)
	at com.ubnt.service.db.oooO.intsuper(Unknown Source)
	at com.ubnt.service.db.oooO.afterPropertiesSet(Unknown Source)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1833)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782)
	... 20 more


is this with clean folders for config on unifi and fully clean on mongo side?
what is the output of uname -mr && docker version

Yes, removed the prior containers with their non-persistent data.

$ uname -mr && docker version
6.1.0-20-amd64 x86_64
Client: Docker Engine - Community
 Version:           26.0.2
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        3c863ff
 Built:             Thu Apr 18 16:27:49 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.0.2
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.9
  Git commit:       7cef0d9
  Built:            Thu Apr 18 16:27:49 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.31
  GitCommit:        e377cd56a71523140ca6ae87e30244719194a521
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

this all looks good to me. do you have anything abnormal, remote mounts (smb/cifs/nfs), podman, rootless stuff
does uid/gid 1000 own /var/lib/docker/volumes/Unifi/_data

Yes

I’m running a UISP stack on the server as well. As far as I know that’s just a standard docker stack. I did make sure there are no port overlaps and that the Unifi application could use its standard ports.

At this point, I would suggest popping into discord for help, i can’t see anything that stands out. When you create your thread in container support ensure you provide your compose and full container logs (dont just link to this post) and link to this post.