Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Configuration fails when mongo password contains '%' and perhaps other special chars. #117

Closed
1 task done
ApexAlpha opened this issue Oct 1, 2024 · 3 comments
Closed
1 task done

Comments

@ApexAlpha
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When MONGO_PASS value contains a percent sign (%) the setup fails with the following error:

[2024-10-01T11:06:07,585Z] <launcher> ERROR mongo  - Could not determine Mongo journaling state
java.lang.IllegalArgumentException: URLDecoder: Incomplete trailing escape (%) pattern

Expected Behavior

Not really something this project should have to fix, but I recommend adding a small comment in the yaml file to make users aware of this limitation.

Example:

environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=
      - MONGO_USER=unifi
      - MONGO_PASS=example #We recommend passwords not containing a '%'

Steps To Reproduce

  1. Setup a password containing %
  2. Launch the containers

Environment

- OS: Linux/Ubuntu
- How docker service was installed: docker apt

CPU architecture

x86-64

Docker creation

docker compose up -d

Container logs

[2024-10-01T11:06:07,204Z] <launcher> INFO  startup - Initiating startup
[2024-10-01T11:06:07,550Z] <launcher> INFO  system - ======================================================================
[2024-10-01T11:06:07,550Z] <launcher> INFO  system - UniFi 8.4.62 (build atag_8.4.62_26656 - release/release) is started
[2024-10-01T11:06:07,551Z] <launcher> INFO  system - Environment: UniFi-OS[false], UniFi-Cloud[false], UniFi-MongoService[false]
[2024-10-01T11:06:07,551Z] <launcher> INFO  system - ======================================================================
[2024-10-01T11:06:07,551Z] <launcher> INFO  system - BASE dir:/usr/lib/unifi
[2024-10-01T11:06:07,555Z] <launcher> INFO  system - Current System IP: 172.18.0.13
[2024-10-01T11:06:07,555Z] <launcher> INFO  system - Hostname: bc4b0a9f891c
[2024-10-01T11:06:07,555Z] <launcher> INFO  system - ubic.env: prod
[2024-10-01T11:06:07,555Z] <launcher> INFO  system - System loaded
[2024-10-01T11:06:07,585Z] <launcher> ERROR mongo  - Could not determine Mongo journaling state
java.lang.IllegalArgumentException: URLDecoder: Incomplete trailing escape (%) pattern
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:230)
	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.ubnt.service.db.A.public(Unknown Source)
	at com.ubnt.service.db.A.Object(Unknown Source)
	at com.ubnt.service.db.A.ô00000(Unknown Source)
	at com.ubnt.service.db.A.Ô00000(Unknown Source)
	at com.ubnt.service.db.I.ô00000(Unknown Source)
	at com.ubnt.service.db.I.Ö00000(Unknown Source)
	at com.ubnt.service.db.I.ÕO0000(Unknown Source)
	at com.ubnt.service.db.I.public(Unknown Source)
	at com.ubnt.service.db.I.OO0000(Unknown Source)
	at com.ubnt.service.db.I.afterPropertiesSet(Unknown Source)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1835)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784)
	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:337)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
	at com.ubnt.service.E.Ô00000(Unknown Source)
	at com.ubnt.service.C.intsuper(Unknown Source)
	at com.ubnt.net.C.publicObject(Unknown Source)
	at com.ubnt.net.C.floatObject(Unknown Source)
	at com.ubnt.net.C.ØÔ0000(Unknown Source)
	at com.ubnt.service.C.Òo0000(Unknown Source)
	at com.ubnt.ace.Launcher.Object(Unknown Source)
	at com.ubnt.ace.Launcher.main(Unknown Source)
[2024-10-01T11:06:07,588Z] <launcher> WARN  AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoRuntimeService' defined in com.ubnt.service.db.CoreDatabaseSpringContext: URLDecoder: Incomplete trailing escape (%) pattern
Copy link

github-actions bot commented Oct 1, 2024

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@aptalca
Copy link
Member

aptalca commented Oct 1, 2024

From the readme:
Mongodb Password. Only evaluated on first run. Special characters must be url encoded.

@ApexAlpha
Copy link
Author

Mhh, I must've read over that (a few times). My bad!

@drizuid drizuid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants