goofball222 / unifi

UniFi Docker Container
Apache License 2.0
252 stars 37 forks source link

Version 8.1.104 breaks external Mongo DB support #137

Closed goofball222 closed 8 months ago

goofball222 commented 9 months ago

Looks like externalized MongoDB support is broken with this release.

In system.properties I have configured & unchanged from working 8.0.28:

db.mongo.local=false
db.mongo.uri=mongodb://XYZ.host:27017/unifi
statdb.mongo.uri=mongodb://XYZ.host:27017/unifi_stat

10-15 seconds after startup:

[2024-02-01 18:18:14,581] <launcher> ERROR mongo - Could not determine Mongo journaling state
com.mongodb.MongoTimeoutException: Timed out after 10000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27117, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]

and

[2024-02-01 18:18:24,587] <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: Timed out after 10000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27117, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
[2024-02-01 18:18:24,588] <launcher> INFO db   - Closing MongoClient

Also post-upgrade both of the system.properties mongo URI had been reread from environment variables with escape slashes added before the colons (\:). Disabled readEnv and manually edited the URIs to remove them with no change in functionality.

https://community.ui.com/releases/UniFi-Network-Application-8-1-104/1a8f4eff-9300-4305-acbf-5b143fc9388d#comment/e543d4e3-7ccc-47d5-818a-44195c1fc9c7

goofball222 commented 9 months ago

Also https://community.ui.com/questions/Version-8-1-104-external-Mongo-DB-support-broken/729ac226-3988-4949-a9b3-cd248190f324

goofball222 commented 9 months ago

Confirmed by Ubiquiti staff, "Will be fixed in next version."

fharbe commented 9 months ago

Unfortunately, I can confirm this issue 😕

goofball222 commented 8 months ago

v8.1.107 beta released, has change notes stating this is fixed - https://community.ui.com/releases/UniFi-Network-Application-8-1-107/c2cb7b81-07b9-43e7-a0ec-f728ab76e8a2

New 8.1 beta tags are building with this version now. TBD if this is actually resolved.

goofball222 commented 8 months ago

v8.1.107 beta released, has change notes stating this is fixed - https://community.ui.com/releases/UniFi-Network-Application-8-1-107/c2cb7b81-07b9-43e7-a0ec-f728ab76e8a2

  • Fixed inability to specify external MongoDB.

New 8.1 beta tags are building with this version now. TBD if this is actually resolved.

Externalized Mongo DB is working as expected for me again now. Will leave this open for a few days in case anyone else wants to chime in.

goofball222 commented 8 months ago

This is stable for me. Upstream definitely appears to have fixed it. Closing.