linuxserver / docker-unifi-network-application

GNU General Public License v3.0
723 stars 54 forks source link

[BUG] 8.3.32 Unable to connect to database #98

Closed wisonlau closed 4 months ago

wisonlau commented 4 months ago

Is there an existing issue for this?

Current Behavior

I installed Docker Composer on macOS, but the connection to the database timed out

Expected Behavior

No response

Steps To Reproduce

docker-compose up

Environment

- OS: mac os 12.6.8
- How docker service was installed:

CPU architecture

x86-64

Docker creation

version: "3.3"
services:
  unifi-db:
    image: docker.io/mongo:5.0
    container_name: unifi-db
    environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=123456
      - MONGO_DBNAME=unifi
      - MONGO_USER=ubnt
      - MONGO_PASS=123456
    ports:
      - 27017:27017
    volumes:
      - /Users/wisonlau/wwwroot/docker/unifi-network-application/mongo-data:/data/db
      - /Users/wisonlau/wwwroot/docker/unifi-network-application/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh: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=ubnt
      - MONGO_PASS=123456
      - MONGO_HOST=unifi-db
      - MONGO_PORT=27017
      - MONGO_DBNAME=unifi
      - MEM_LIMIT=1024 #optional
      - MEM_STARTUP=1024 #optional
      - MONGO_TLS= #optional
      - MONGO_AUTHSOURCE= #optional
    volumes:
      - /Users/wisonlau/wwwroot/docker/unifi-network-application/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
#!/bin/bash

mongo <<EOF
use admin
db.auth("${MONGO_INITDB_ROOT_USERNAME}", "${MONGO_INITDB_ROOT_PASSWORD}")
use ${MONGO_DBNAME}
db.createUser({
  user: "${MONGO_USER}",
  pwd: "${MONGO_PASS}",
  roles: [
    { db: "${MONGO_DBNAME}", role: "dbOwner" },
    { db: "${MONGO_DBNAME}_stat", role: "dbOwner" }
  ]
})
EOF

Container logs

(base) ➜  unifi-network-application docker-compose up
[+] Running 3/3
 ⠿ Network unifi-network-application_default  Created                                                                           0.1s
 ⠿ Container unifi-db                         Created                                                                           0.1s
 ⠿ Container unifi-network-application        Created                                                                           0.1s
Attaching to unifi-db, unifi-network-application
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.361+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.362+00:00"},"s":"I",  "c":"NETWORK",  "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":true}}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.367+00:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.367+00:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.369+00:00"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.369+00:00"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","ns":"config.tenantMigrationDonors"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.369+00:00"},"s":"I",  "c":"REPL",     "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","ns":"config.tenantMigrationRecipients"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.369+00:00"},"s":"I",  "c":"CONTROL",  "id":5945603, "ctx":"main","msg":"Multi threading initialized"}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.370+00:00"},"s":"I",  "c":"CONTROL",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"9d297d33f52a"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.370+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"5.0.28","gitVersion":"a8f8b8e1e271f236e761d0138e2418d0a114c941","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.370+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.370+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"},"security":{"authorization":"enabled"}}}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.378+00:00"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/data/db","storageEngine":"wiredTiger"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:48.386+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=3417M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],"}}
unifi-network-application  | [migrations] started
unifi-network-application  | [migrations] no migrations found
unifi-network-application  | usermod: no changes
unifi-network-application  | ───────────────────────────────────────
unifi-network-application  |
unifi-network-application  |       ██╗     ███████╗██╗ ██████╗
unifi-network-application  |       ██║     ██╔════╝██║██╔═══██╗
unifi-network-application  |       ██║     ███████╗██║██║   ██║
unifi-network-application  |       ██║     ╚════██║██║██║   ██║
unifi-network-application  |       ███████╗███████║██║╚██████╔╝
unifi-network-application  |       ╚══════╝╚══════╝╚═╝ ╚═════╝
unifi-network-application  |
unifi-network-application  |    Brought to you by linuxserver.io
unifi-network-application  | ───────────────────────────────────────
unifi-network-application  |
unifi-network-application  | To support LSIO projects visit:
unifi-network-application  | https://www.linuxserver.io/donate/
unifi-network-application  |
unifi-network-application  | ───────────────────────────────────────
unifi-network-application  | GID/UID
unifi-network-application  | ───────────────────────────────────────
unifi-network-application  |
unifi-network-application  | User UID:    911
unifi-network-application  | User GID:    911
unifi-network-application  | ───────────────────────────────────────
unifi-network-application  |
unifi-network-application  | [custom-init] No custom files found, skipping...
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:49.237+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241589:237526][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 5 through 6"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:50.684+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241590:684586][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 6 through 6"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.179+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:179860][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_ALL] Main recovery loop: starting at 5/11904 to 6/256"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.297+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:297410][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 5 through 6"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.411+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:411535][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 6 through 6"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.467+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:467214][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_PROGRESS] recovery log replay has successfully finished and ran for 3233 milliseconds"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.467+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:467332][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_ALL] Set global recovery timestamp: (0, 0)"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.467+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:467356][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_ALL] Set global oldest timestamp: (0, 0)"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.468+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:468207][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_PROGRESS] recovery rollback to stable has successfully finished and ran for 0 milliseconds"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.503+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:503773][1:0x7fe2156c8c80], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 1, snapshot max: 1 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 93"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.523+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:523733][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_PROGRESS] recovery checkpoint has successfully finished and ran for 20 milliseconds"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.527+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1721241592:527832][1:0x7fe2156c8c80], txn-recover: [WT_VERB_RECOVERY_PROGRESS] recovery was completed successfully and took 3294ms, including 3233ms for the log replay, 0ms for the rollback to stable, and 20ms for the checkpoint."}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.532+00:00"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":4146}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.533+00:00"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.556+00:00"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.585+00:00"},"s":"I",  "c":"NETWORK",  "id":4915702, "ctx":"initandlisten","msg":"Updated wire specification","attr":{"oldSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":true},"newSpec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":13,"maxWireVersion":13},"outgoing":{"minWireVersion":13,"maxWireVersion":13},"isInternalClient":true}}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.589+00:00"},"s":"I",  "c":"STORAGE",  "id":5071100, "ctx":"initandlisten","msg":"Clearing temp directory"}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.594+00:00"},"s":"I",  "c":"CONTROL",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.600+00:00"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.615+00:00"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.619+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.619+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}}
unifi-db                   | {"t":{"$date":"2024-07-17T18:39:52.619+00:00"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
unifi-network-application  | Exception in thread "launcher" java.lang.IllegalStateException: Tomcat failed to start up
unifi-network-application  |    at com.ubnt.net.O0OO.ÓÔ0000(Unknown Source)
unifi-network-application  |    at com.ubnt.service.C.Òo0000(Unknown Source)
unifi-network-application  |    at com.ubnt.ace.Launcher.Object(Unknown Source)
unifi-network-application  |    at com.ubnt.ace.Launcher.main(Unknown Source)
unifi-network-application  | Caused by: 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=172.16.0.23:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: Connect timed out}}]
unifi-network-application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786)
unifi-network-application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
unifi-network-application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
unifi-network-application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
unifi-network-application  |    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
unifi-network-application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
unifi-network-application  |    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
unifi-network-application  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
unifi-network-application  |    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962)
unifi-network-application  |    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
unifi-network-application  |    at com.ubnt.service.E.Ô00000(Unknown Source)
unifi-network-application  |    at com.ubnt.service.C.intsuper(Unknown Source)
unifi-network-application  |    at com.ubnt.net.O0OO.ÕÔ0000(Unknown Source)
unifi-network-application  |    at com.ubnt.net.O0OO.oÔ0000(Unknown Source)
unifi-network-application  |    ... 4 more
unifi-network-application  | Caused by: 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=172.16.0.23:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: Connect timed out}}]
unifi-network-application  |    at com.mongodb.internal.connection.BaseCluster.createTimeoutException(BaseCluster.java:380)
unifi-network-application  |    at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:125)
unifi-network-application  |    at com.mongodb.internal.connection.SingleServerCluster.selectServer(SingleServerCluster.java:46)
unifi-network-application  |    at com.mongodb.internal.binding.ClusterBinding.getReadConnectionSource(ClusterBinding.java:116)
unifi-network-application  |    at com.mongodb.client.internal.ClientSessionBinding.getConnectionSource(ClientSessionBinding.java:128)
unifi-network-application  |    at com.mongodb.client.internal.ClientSessionBinding.getReadConnectionSource(ClientSessionBinding.java:92)
unifi-network-application  |    at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource(SyncOperationHelper.java:144)
unifi-network-application  |    at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection(SyncOperationHelper.java:125)
unifi-network-application  |    at com.mongodb.internal.operation.SyncOperationHelper.lambda$executeRetryableRead$4(SyncOperationHelper.java:189)
unifi-network-application  |    at com.mongodb.internal.operation.SyncOperationHelper.lambda$decorateReadWithRetries$12(SyncOperationHelper.java:292)
unifi-network-application  |    at com.mongodb.internal.async.function.RetryingSyncSupplier.get(RetryingSyncSupplier.java:67)
unifi-network-application  |    at com.mongodb.internal.operation.SyncOperationHelper.executeRetryableRead(SyncOperationHelper.java:194)
unifi-network-application  |    at com.mongodb.internal.operation.SyncOperationHelper.executeRetryableRead(SyncOperationHelper.java:176)
unifi-network-application  |    at com.mongodb.internal.operation.CommandReadOperation.execute(CommandReadOperation.java:48)
unifi-network-application  |    at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:153)
unifi-network-application  |    at com.mongodb.client.internal.MongoDatabaseImpl.executeCommand(MongoDatabaseImpl.java:196)
unifi-network-application  |    at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:165)
unifi-network-application  |    at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:160)
unifi-network-application  |    at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:150)
unifi-network-application  |    at com.ubnt.service.db.J.Óo0000(Unknown Source)
unifi-network-application  |    at com.ubnt.service.db.J.afterPropertiesSet(Unknown Source)
unifi-network-application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1833)
unifi-network-application  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782)
unifi-network-application  |    ... 17 more
github-actions[bot] commented 4 months ago

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

j0nnymoe commented 4 months ago

You've deployed the mondodb exactly how we said in our readme not to do. You need to make sure mongodb is starting up correctly first.

Also, just as an FYI - we don't test our containers on MacOS so your milage may vary.

Plawasan commented 4 months ago

Same issue on TurnKey GNU/Linux 17.1 (Debian 11/Bullseye) (running on Proxmox as an LXC container), I then tried to revert back to [8.2.93-ls48] (which was what I was upgrading from) but the DB error was still there so I had to resort to restoring the whole LXC from backup.

version: "2.1" # Docker Compose file version

services: # Define the services to run
  unifi-db:
    image: mongo:6.0.11
    container_name: unifi-db
    volumes:
      - /DATA/AppData/unifi-network-application/db/data:/data/db # MongoDB data persistence
      - /DATA/AppData/unifi-network-application/db/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    ports:
      - 27017:27017 # MongoDB default port
    restart: unless-stopped # Restart policy

  unifi-network-application: # Name of the service
    image: lscr.io/linuxserver/unifi-network-application:latest # Docker image to use
    container_name: unifi-network-application # Name for the created container
    environment: # Environmental variables for the container
      - PUID=1000 # User ID
      - PGID=1000 # Group ID
      - TZ=Europe/Prague # Timezone
      - MONGO_HOST=unifi-db # MongoDB host
      - MONGO_USER=unifi # MongoDB username
      - MONGO_PORT=27017 # MongoDB port
      - MONGO_DBNAME=unifi # MongoDB database name
      - MEM_LIMIT=1024 #optional  # Memory limit for the container
      - MEM_STARTUP=1024 #optional  # Memory to allocate on container startup
      - MONGO_TLS= #optional  # MongoDB TLS setting
      - MONGO_AUTHSOURCE= #optional  # MongoDB authentication source
    volumes: # Volumes to mount in the container
      - /DATA/AppData/unifi-network-application/config:/config # Map host directory to container directory
    ports: # Ports to expose and forward
      - 8443:8443 # HTTPS portal
      - 3478:3478/udp # STUN service
      - 10001:10001/udp # UniFi AP discovery
      - 8080:8080 # HTTP portal
      - 1900:1900/udp #optional  # For DLNA
      - 8843:8843 #optional  # HTTPS guest portal
      - 8880:8880 #optional  # HTTP guest portal
      - 6789:6789 #optional  # Mobile speed test port
      - 5514:5514/udp #optional  # Remote syslog port
    restart: unless-stopped # Restart policy for the container
    depends_on:
      - unifi-db
Plawasan commented 4 months ago

Not sure if anything changed on your end but I just did the same exact thing I did earlier today (redeploy the entire stack) and now it seems to work ok...

aptalca commented 4 months ago

Please don't same issue a completely different thing.

OP included things that the readme specifically states not to include.

Your issue is not it. Also keep in mind that we don't support or recommend running docker in lxc. Even the proxmox devs recommend against running docker in lxc.

wisonlau commented 4 months ago

您已按照我们在自述文件中所说的方式部署了 mondodb。您需要先确保 mongodb 正确启动。

此外,仅供参考 - 我们不会在 MacOS 上测试我们的容器,因此您的里程可能会有所不同。

mongodb

MongoDB is running normally

I can connect normally using Navicat Premium and create a database

wisonlau commented 4 months ago

Need to delete /Users/wisonlau/wwwroot/docker/unifi-network-application/mongo-data and /Users/wisonlau/wwwroot/docker/unifi-network-application/unifi-data