If a password (or username) contains special characters the container does not run properly, the error is not available on stdout but only in server.log
To fix this it is required to clear the unifi config dir, as the username and password are persisted after first boot.
Expected Behavior
The documentation should include a note to use urlencoding on password and username if they contain special characters.
Steps To Reproduce
set up a mongodb user with a password containing special characters.
Use unencoded password in MONGO_PASS.
Service was not started, server.log contains error message.
Environment
- OS: armbian
- How docker service was installed: using docker apt repository
CPU architecture
arm64
Docker creation
using docker compose
Container logs
[2023-09-11 09:39:48,615] <launcher> INFO db - Connecting to mongodb://[MONGO_USER]:[MONGO_PASS](REDACTED)@unifi-mongo-db:27017/unifi
[2023-09-11 09:39:48,616] <launcher> ERROR db - Error creating mongo client...
java.lang.IllegalArgumentException: The connection string contains invalid user information. If the username or password contains a colon (:) or an at-sign (@) then it must be urlencoded
at com.mongodb.ConnectionString.<init>(ConnectionString.java:337)
at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:257)
at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:239)
at com.ubnt.service.system.z.Óõ0000(Unknown Source)
at com.ubnt.service.system.z.ø0O000(Unknown Source)
at com.ubnt.service.system.z.øõ0000(Unknown Source)
at com.ubnt.service.system.z.ÖØ0000(Unknown Source)
at com.ubnt.service.system.z.whilevoid(Unknown Source)
at com.ubnt.service.system.z.afterPropertiesSet(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at com.ubnt.service.E.Object(Unknown Source)
at com.ubnt.service.Object.oo0000(Unknown Source)
at com.ubnt.net.SpringConfig.onStartup(Unknown Source)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at com.ubnt.net.OoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Oo0000(Unknown Source)
at com.ubnt.net.OoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.Òo0000(Unknown Source)
at com.ubnt.service.Object.øÓ0000(Unknown Source)
at com.ubnt.ace.Launcher.Object(Unknown Source)
at com.ubnt.ace.Launcher.main(Unknown Source)
Is there an existing issue for this?
Current Behavior
If a password (or username) contains special characters the container does not run properly, the error is not available on stdout but only in server.log To fix this it is required to clear the unifi config dir, as the username and password are persisted after first boot.
Expected Behavior
The documentation should include a note to use urlencoding on password and username if they contain special characters.
Steps To Reproduce
set up a mongodb user with a password containing special characters. Use unencoded password in MONGO_PASS. Service was not started, server.log contains error message.
Environment
CPU architecture
arm64
Docker creation
Container logs