linuxserver / docker-unifi-network-application

GNU General Public License v3.0
553 stars 41 forks source link

[BUG] FILE__* for environment variables not working #26

Closed mtihlenfield closed 8 months ago

mtihlenfield commented 8 months ago

Is there an existing issue for this?

Current Behavior

I've found using FILE__<variable> environment variables does not actually result in the being set. I've specifically been trying to do this with FILE__MONGO_PASS so that I could add the password as a docker secret.

If I use just MONGO_PASS, my compose setup works correctly and unifi is able to connect to the database. But if I use FILE__MONGO_PASS it fails to authenticate with the database.

Expected Behavior

The container scripts should pull the mongo db user password from the secret file provided via FILE__MONGO_PASS. From what I understand the MONGO_PASS environment variable should be set, but that doesn't seem to be happeneing:

docker exec -it unifi env | grep MONGO
FILE__MONGO_PASS=/run/secrets/unifi_mongodb_password
MONGO_HOST=localhost
MONGO_PORT=27017
MONGO_DBNAME=unifi
MONGO_USER=unifi

Steps To Reproduce

  1. Run docker compose up using the compose file below. Make sure to use clean volumes.

Environment

- OS:Ubuntu 20.04
- How docker service was installed:
    Using the system package manager, but using the docker apt repository as described here: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
- Docker version: 24.0.6

CPU architecture

x86-64

Docker creation

The compose file:

---

services:
  unifi:
    image: lscr.io/linuxserver/unifi-network-application:latest
    container_name: unifi
    restart: unless-stopped
    depends_on:
      - mongodb
    environment:
      PUID: 1000
      PGID: 1000
      TZ: America/New_York
      MONGO_USER: unifi
      FILE__MONGO_PASS: /run/secrets/unifi_mongodb_password
      # MONGO_PASS: password
      MONGO_HOST: localhost
      MONGO_PORT: 27017
      MONGO_DBNAME: unifi
    volumes:
      - unifi-config:/config
    secrets:
      - unifi_mongodb_password
    network_mode: host

  mongodb:
    image: mongo:4.4
    container_name: mongodb
    restart: unless-stopped
    ports:
      - 127.0.0.1:27017:27017
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/root_mongodb_password
      MONGO_UNIFI_PASSWORD_FILE: /run/secrets/unifi_mongodb_password
    volumes:
      - mongodb:/data/db
      - ./init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro
    secrets:
      - unifi_mongodb_password
      - root_mongodb_password

volumes:
  unifi-config:
    name: unifi-config
  mongodb:
    name: mongodb

secrets:
  unifi_mongodb_password:
    file: ./secrets/unifi_mongodb_password.txt
  root_mongodb_password:
    file: ./secrets/root_mongodb_password.txt

init-mongo.sh:

set -e

MONGO_UNIFI_PASS="$(cat "$MONGO_UNIFI_PASSWORD_FILE")"

mongo <<EOF
disableTelemetry();

use unifi
db.createUser({
    user: 'unifi',
    pwd: '$MONGO_UNIFI_PASS',
    roles: [
        {role: 'dbOwner', db: 'unifi'},
        {role: 'dbOwner', db: 'unifi_stat'},
    ]
})

use unifi_stat
db.createUser({
    user: 'unifi',
    pwd: '$MONGO_UNIFI_PASS',
    roles: [
        {role: 'dbOwner', db: 'unifi'},
        {role: 'dbOwner', db: 'unifi_stat'},
    ]
})
EOF

Container logs

Unifi logs:

[migrations] started
[migrations] no migrations found
[env-init] MONGO_PASS set from FILE__MONGO_PASS
───────────────────────────────────────

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

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

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

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

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

sed: -e expression #1, char 23: unterminated `s' command
Generating 4,096 bit RSA key pair and self-signed certificate (SHA384withRSA) with a validity of 3,650 days
        for: CN=unifi
[custom-init] No custom files found, skipping...

mongodb logs:

bout to fork child process, waiting until server is ready for connections.
forked process: 29

{"t":{"$date":"2023-10-27T20:55:26.509+00:00"},"s":"I",  "c":"CONTROL",  "id":20698,   "ctx":"main","msg":"***** SERVER RESTARTED *****"}
{"t":{"$date":"2023-10-27T20:55:26.511+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2023-10-27T20:55:26.513+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."}
{"t":{"$date":"2023-10-27T20:55:26.513+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":29,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"0bd577c69386"}}
{"t":{"$date":"2023-10-27T20:55:26.513+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.25","gitVersion":"3e18c4c56048ddf22a6872edc111b542521ad1d5","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2023-10-27T20:55:26.513+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
{"t":{"$date":"2023-10-27T20:55:26.513+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"127.0.0.1","port":27017,"tls":{"mode":"disabled"}},"processManagement":{"fork":true,"pidFilePath":"/tmp/docker-entrypoint-temp-mongod.pid"},"systemLog":{"destination":"file","logAppend":true,"path":"/proc/1/fd/1"}}}}
{"t":{"$date":"2023-10-27T20:55:26.513+00:00"},"s":"I",  "c":"STORAGE",  "id":22297,   "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]}
{"t":{"$date":"2023-10-27T20:55:26.513+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=7365M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],"}}
{"t":{"$date":"2023-10-27T20:55:26.734+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440126:734214][29:0x7f704aee7cc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global recovery timestamp: (0, 0)"}}
{"t":{"$date":"2023-10-27T20:55:26.734+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440126:734264][29:0x7f704aee7cc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global oldest timestamp: (0, 0)"}}
{"t":{"$date":"2023-10-27T20:55:26.743+00:00"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":230}}
{"t":{"$date":"2023-10-27T20:55:26.743+00:00"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2023-10-27T20:55:26.762+00:00"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
{"t":{"$date":"2023-10-27T20:55:26.771+00:00"},"s":"W",  "c":"CONTROL",  "id":22120,   "ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
{"t":{"$date":"2023-10-27T20:55:26.771+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"admin.system.version","uuidDisposition":"provided","uuid":{"uuid":{"$uuid":"0d70baf6-0476-4395-bce1-2089ec300e33"}},"options":{"uuid":{"$uuid":"0d70baf6-0476-4395-bce1-2089ec300e33"}}}}
{"t":{"$date":"2023-10-27T20:55:26.785+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"admin.system.version","index":"_id_","commitTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2023-10-27T20:55:26.785+00:00"},"s":"I",  "c":"COMMAND",  "id":20459,   "ctx":"initandlisten","msg":"Setting featureCompatibilityVersion","attr":{"newVersion":"4.4"}}
{"t":{"$date":"2023-10-27T20:55:26.785+00:00"},"s":"I",  "c":"STORAGE",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
{"t":{"$date":"2023-10-27T20:55:26.786+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"initandlisten","msg":"createCollection","attr":{"namespace":"local.startup_log","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"37e829ba-b8e4-4d8a-b3b5-35df4f47c5ce"}},"options":{"capped":true,"size":10485760}}}
{"t":{"$date":"2023-10-27T20:55:26.800+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"initandlisten","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"local.startup_log","index":"_id_","commitTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2023-10-27T20:55:26.801+00:00"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}}
{"t":{"$date":"2023-10-27T20:55:26.801+00:00"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
{"t":{"$date":"2023-10-27T20:55:26.801+00:00"},"s":"I",  "c":"CONTROL",  "id":20712,   "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
{"t":{"$date":"2023-10-27T20:55:26.801+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
{"t":{"$date":"2023-10-27T20:55:26.802+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"127.0.0.1"}}
{"t":{"$date":"2023-10-27T20:55:26.802+00:00"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
{"t":{"$date":"2023-10-27T20:55:26.802+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"LogicalSessionCacheRefresh","msg":"createCollection","attr":{"namespace":"config.system.sessions","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"0c508318-a2a0-4d2d-b991-b53a7a2fa87a"}},"options":{}}}
child process started successfully, parent exiting
{"t":{"$date":"2023-10-27T20:55:26.847+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"LogicalSessionCacheRefresh","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"config.system.sessions","index":"_id_","commitTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2023-10-27T20:55:26.847+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"LogicalSessionCacheRefresh","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"config.system.sessions","index":"lsidTTLIndex","commitTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2023-10-27T20:55:26.860+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:40396","connectionId":1,"connectionCount":1}}
{"t":{"$date":"2023-10-27T20:55:26.861+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn1","msg":"client metadata","attr":{"remote":"127.0.0.1:40396","client":"conn1","doc":{"application":{"name":"MongoDB Shell"},"driver":{"name":"MongoDB Internal Client","version":"4.4.25"},"os":{"type":"Linux","name":"Ubuntu","architecture":"x86_64","version":"20.04"}}}}
{"t":{"$date":"2023-10-27T20:55:26.866+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1","msg":"Connection ended","attr":{"remote":"127.0.0.1:40396","connectionId":1,"connectionCount":0}}
{"t":{"$date":"2023-10-27T20:55:27.009+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:40412","connectionId":2,"connectionCount":1}}
{"t":{"$date":"2023-10-27T20:55:27.009+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn2","msg":"client metadata","attr":{"remote":"127.0.0.1:40412","client":"conn2","doc":{"application":{"name":"MongoDB Shell"},"driver":{"name":"MongoDB Internal Client","version":"4.4.25"},"os":{"type":"Linux","name":"Ubuntu","architecture":"x86_64","version":"20.04"}}}}
{"t":{"$date":"2023-10-27T20:55:27.034+00:00"},"s":"I",  "c":"STORAGE",  "id":20320,   "ctx":"conn2","msg":"createCollection","attr":{"namespace":"admin.system.users","uuidDisposition":"generated","uuid":{"uuid":{"$uuid":"13f964e4-763b-47d1-9913-a4552a2f3516"}},"options":{}}}
{"t":{"$date":"2023-10-27T20:55:27.057+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"conn2","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"admin.system.users","index":"_id_","commitTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2023-10-27T20:55:27.057+00:00"},"s":"I",  "c":"INDEX",    "id":20345,   "ctx":"conn2","msg":"Index build: done building","attr":{"buildUUID":null,"namespace":"admin.system.users","index":"user_1_db_1","commitTimestamp":{"$timestamp":{"t":0,"i":0}}}}
Successfully added user: {
        "user" : "root",
        "roles" : [
                {
                        "role" : "root",
                        "db" : "admin"
                }
        ]
}
{"t":{"$date":"2023-10-27T20:55:27.059+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn2","msg":"Connection ended","attr":{"remote":"127.0.0.1:40412","connectionId":2,"connectionCount":0}}

/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/init-mongo.sh
MongoDB shell version v4.4.25
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
{"t":{"$date":"2023-10-27T20:55:27.103+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:40424","connectionId":3,"connectionCount":1}}
{"t":{"$date":"2023-10-27T20:55:27.104+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn3","msg":"client metadata","attr":{"remote":"127.0.0.1:40424","client":"conn3","doc":{"application":{"name":"MongoDB Shell"},"driver":{"name":"MongoDB Internal Client","version":"4.4.25"},"os":{"type":"Linux","name":"Ubuntu","architecture":"x86_64","version":"20.04"}}}}
Implicit session: session { "id" : UUID("78da8519-8862-4657-b4e1-4febbbf92254") }
MongoDB server version: 4.4.25
uncaught exception: ReferenceError: disableTelemetry is not defined :
@(shell):1:1
switched to db unifi
Successfully added user: {
        "user" : "unifi",
        "roles" : [
                {
                        "role" : "dbOwner",
                        "db" : "unifi"
                },
                {
                        "role" : "dbOwner",
                        "db" : "unifi_stat"
                }
        ]
}
switched to db unifi_stat
Successfully added user: {
        "user" : "unifi",
        "roles" : [
                {
                        "role" : "dbOwner",
                        "db" : "unifi"
                },
                {
                        "role" : "dbOwner",
                        "db" : "unifi_stat"
                }
        ]
}
bye
{"t":{"$date":"2023-10-27T20:55:27.157+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn3","msg":"Connection ended","attr":{"remote":"127.0.0.1:40424","connectionId":3,"connectionCount":0}}

{"t":{"$date":"2023-10-27T20:55:27.172+00:00"},"s":"I",  "c":"CONTROL",  "id":20698,   "ctx":"main","msg":"***** SERVER RESTARTED *****"}
{"t":{"$date":"2023-10-27T20:55:27.173+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2023-10-27T20:55:27.174+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."}
killing process with pid: 29
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"CONTROL",  "id":23377,   "ctx":"SignalHandler","msg":"Received signal","attr":{"signal":15,"error":"Terminated"}}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"CONTROL",  "id":23378,   "ctx":"SignalHandler","msg":"Signal was sent by kill(2)","attr":{"pid":88,"uid":999}}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"CONTROL",  "id":23381,   "ctx":"SignalHandler","msg":"will terminate after current cmd ends"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"REPL",     "id":4784900, "ctx":"SignalHandler","msg":"Stepping down the ReplicationCoordinator for shutdown","attr":{"waitTimeMillis":10000}}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"COMMAND",  "id":4784901, "ctx":"SignalHandler","msg":"Shutting down the MirrorMaestro"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"SHARDING", "id":4784902, "ctx":"SignalHandler","msg":"Shutting down the WaitForMajorityService"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"CONTROL",  "id":4784903, "ctx":"SignalHandler","msg":"Shutting down the LogicalSessionCache"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"NETWORK",  "id":20562,   "ctx":"SignalHandler","msg":"Shutdown: going to close listening sockets"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"NETWORK",  "id":23017,   "ctx":"listener","msg":"removing socket file","attr":{"path":"/tmp/mongodb-27017.sock"}}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"NETWORK",  "id":4784905, "ctx":"SignalHandler","msg":"Shutting down the global connection pool"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"STORAGE",  "id":4784906, "ctx":"SignalHandler","msg":"Shutting down the FlowControlTicketholder"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"-",        "id":20520,   "ctx":"SignalHandler","msg":"Stopping further Flow Control ticket acquisitions."}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"STORAGE",  "id":4784908, "ctx":"SignalHandler","msg":"Shutting down the PeriodicThreadToAbortExpiredTransactions"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"STORAGE",  "id":4784934, "ctx":"SignalHandler","msg":"Shutting down the PeriodicThreadToDecreaseSnapshotHistoryCachePressure"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"REPL",     "id":4784909, "ctx":"SignalHandler","msg":"Shutting down the ReplicationCoordinator"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"SHARDING", "id":4784910, "ctx":"SignalHandler","msg":"Shutting down the ShardingInitializationMongoD"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"REPL",     "id":4784911, "ctx":"SignalHandler","msg":"Enqueuing the ReplicationStateTransitionLock for shutdown"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"-",        "id":4784912, "ctx":"SignalHandler","msg":"Killing all operations for shutdown"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"-",        "id":4695300, "ctx":"SignalHandler","msg":"Interrupted all currently running operations","attr":{"opsKilled":3}}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"COMMAND",  "id":4784913, "ctx":"SignalHandler","msg":"Shutting down all open transactions"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"REPL",     "id":4784914, "ctx":"SignalHandler","msg":"Acquiring the ReplicationStateTransitionLock for shutdown"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"INDEX",    "id":4784915, "ctx":"SignalHandler","msg":"Shutting down the IndexBuildsCoordinator"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"REPL",     "id":4784916, "ctx":"SignalHandler","msg":"Reacquiring the ReplicationStateTransitionLock for shutdown"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"REPL",     "id":4784917, "ctx":"SignalHandler","msg":"Attempting to mark clean shutdown"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"NETWORK",  "id":4784918, "ctx":"SignalHandler","msg":"Shutting down the ReplicaSetMonitor"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"SHARDING", "id":4784921, "ctx":"SignalHandler","msg":"Shutting down the MigrationUtilExecutor"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"STORAGE",  "id":4784927, "ctx":"SignalHandler","msg":"Shutting down the HealthLog"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"STORAGE",  "id":4784929, "ctx":"SignalHandler","msg":"Acquiring the global lock for shutdown"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"STORAGE",  "id":4784930, "ctx":"SignalHandler","msg":"Shutting down the storage engine"}
{"t":{"$date":"2023-10-27T20:55:27.175+00:00"},"s":"I",  "c":"STORAGE",  "id":22320,   "ctx":"SignalHandler","msg":"Shutting down journal flusher thread"}
{"t":{"$date":"2023-10-27T20:55:27.176+00:00"},"s":"I",  "c":"STORAGE",  "id":22321,   "ctx":"SignalHandler","msg":"Finished shutting down journal flusher thread"}
{"t":{"$date":"2023-10-27T20:55:27.176+00:00"},"s":"I",  "c":"STORAGE",  "id":20282,   "ctx":"SignalHandler","msg":"Deregistering all the collections"}
{"t":{"$date":"2023-10-27T20:55:27.176+00:00"},"s":"I",  "c":"STORAGE",  "id":22261,   "ctx":"SignalHandler","msg":"Timestamp monitor shutting down"}
{"t":{"$date":"2023-10-27T20:55:27.176+00:00"},"s":"I",  "c":"STORAGE",  "id":22317,   "ctx":"SignalHandler","msg":"WiredTigerKVEngine shutting down"}
{"t":{"$date":"2023-10-27T20:55:27.176+00:00"},"s":"I",  "c":"STORAGE",  "id":22318,   "ctx":"SignalHandler","msg":"Shutting down session sweeper thread"}
{"t":{"$date":"2023-10-27T20:55:27.176+00:00"},"s":"I",  "c":"STORAGE",  "id":22319,   "ctx":"SignalHandler","msg":"Finished shutting down session sweeper thread"}
{"t":{"$date":"2023-10-27T20:55:27.176+00:00"},"s":"I",  "c":"STORAGE",  "id":22322,   "ctx":"SignalHandler","msg":"Shutting down checkpoint thread"}
{"t":{"$date":"2023-10-27T20:55:27.176+00:00"},"s":"I",  "c":"STORAGE",  "id":22323,   "ctx":"SignalHandler","msg":"Finished shutting down checkpoint thread"}
{"t":{"$date":"2023-10-27T20:55:27.177+00:00"},"s":"I",  "c":"STORAGE",  "id":4795902, "ctx":"SignalHandler","msg":"Closing WiredTiger","attr":{"closeConfig":"leak_memory=true,"}}
{"t":{"$date":"2023-10-27T20:55:27.178+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"SignalHandler","msg":"WiredTiger message","attr":{"message":"[1698440127:178596][29:0x7f704aee6700], close_ckpt: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 49, snapshot max: 49 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1"}}
{"t":{"$date":"2023-10-27T20:55:27.215+00:00"},"s":"I",  "c":"STORAGE",  "id":4795901, "ctx":"SignalHandler","msg":"WiredTiger closed","attr":{"durationMillis":38}}
{"t":{"$date":"2023-10-27T20:55:27.215+00:00"},"s":"I",  "c":"STORAGE",  "id":22279,   "ctx":"SignalHandler","msg":"shutdown: removing fs lock..."}
{"t":{"$date":"2023-10-27T20:55:27.215+00:00"},"s":"I",  "c":"-",        "id":4784931, "ctx":"SignalHandler","msg":"Dropping the scope cache for shutdown"}
{"t":{"$date":"2023-10-27T20:55:27.215+00:00"},"s":"I",  "c":"FTDC",     "id":4784926, "ctx":"SignalHandler","msg":"Shutting down full-time data capture"}
{"t":{"$date":"2023-10-27T20:55:27.215+00:00"},"s":"I",  "c":"FTDC",     "id":20626,   "ctx":"SignalHandler","msg":"Shutting down full-time diagnostic data capture"}
{"t":{"$date":"2023-10-27T20:55:27.217+00:00"},"s":"I",  "c":"CONTROL",  "id":20565,   "ctx":"SignalHandler","msg":"Now exiting"}
{"t":{"$date":"2023-10-27T20:55:27.217+00:00"},"s":"I",  "c":"CONTROL",  "id":23138,   "ctx":"SignalHandler","msg":"Shutting down","attr":{"exitCode":0}}

MongoDB init process complete; ready for start up.

{"t":{"$date":"2023-10-27T20:55:28.190+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2023-10-27T20:55:28.191+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."}
{"t":{"$date":"2023-10-27T20:55:28.192+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"0bd577c69386"}}
{"t":{"$date":"2023-10-27T20:55:28.192+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.25","gitVersion":"3e18c4c56048ddf22a6872edc111b542521ad1d5","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2023-10-27T20:55:28.192+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
{"t":{"$date":"2023-10-27T20:55:28.192+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"},"security":{"authorization":"enabled"}}}}
{"t":{"$date":"2023-10-27T20:55:28.192+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"}}
{"t":{"$date":"2023-10-27T20:55:28.192+00:00"},"s":"I",  "c":"STORAGE",  "id":22297,   "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]}
{"t":{"$date":"2023-10-27T20:55:28.192+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=7365M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],"}}
{"t":{"$date":"2023-10-27T20:55:28.338+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440128:338076][1:0x7fe0c89a2cc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 1 through 2"}}
{"t":{"$date":"2023-10-27T20:55:28.390+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440128:390412][1:0x7fe0c89a2cc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 2 through 2"}}
{"t":{"$date":"2023-10-27T20:55:28.441+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440128:441364][1:0x7fe0c89a2cc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Main recovery loop: starting at 1/33152 to 2/256"}}
{"t":{"$date":"2023-10-27T20:55:28.502+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440128:502291][1:0x7fe0c89a2cc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 1 through 2"}}
{"t":{"$date":"2023-10-27T20:55:28.540+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440128:540865][1:0x7fe0c89a2cc0], txn-recover: [WT_VERB_RECOVERY_PROGRESS] Recovering log 2 through 2"}}
{"t":{"$date":"2023-10-27T20:55:28.571+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440128:571753][1:0x7fe0c89a2cc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global recovery timestamp: (0, 0)"}}
{"t":{"$date":"2023-10-27T20:55:28.571+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440128:571788][1:0x7fe0c89a2cc0], txn-recover: [WT_VERB_RECOVERY | WT_VERB_RECOVERY_PROGRESS] Set global oldest timestamp: (0, 0)"}}
{"t":{"$date":"2023-10-27T20:55:28.574+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1698440128:574553][1:0x7fe0c89a2cc0], 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: 7"}}
{"t":{"$date":"2023-10-27T20:55:28.585+00:00"},"s":"I",  "c":"STORAGE",  "id":4795906, "ctx":"initandlisten","msg":"WiredTiger opened","attr":{"durationMillis":393}}
{"t":{"$date":"2023-10-27T20:55:28.585+00:00"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
{"t":{"$date":"2023-10-27T20:55:28.588+00:00"},"s":"I",  "c":"STORAGE",  "id":22262,   "ctx":"initandlisten","msg":"Timestamp monitor starting"}
{"t":{"$date":"2023-10-27T20:55:28.596+00:00"},"s":"I",  "c":"STORAGE",  "id":20536,   "ctx":"initandlisten","msg":"Flow Control is enabled on this deployment"}
{"t":{"$date":"2023-10-27T20:55:28.598+00:00"},"s":"I",  "c":"FTDC",     "id":20625,   "ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/data/db/diagnostic.data"}}
{"t":{"$date":"2023-10-27T20:55:28.598+00:00"},"s":"I",  "c":"REPL",     "id":6015317, "ctx":"initandlisten","msg":"Setting new configuration state","attr":{"newState":"ConfigReplicationDisabled","oldState":"ConfigPreStart"}}
{"t":{"$date":"2023-10-27T20:55:28.599+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
{"t":{"$date":"2023-10-27T20:55:28.599+00:00"},"s":"I",  "c":"NETWORK",  "id":23015,   "ctx":"listener","msg":"Listening on","attr":{"address":"0.0.0.0"}}
{"t":{"$date":"2023-10-27T20:55:28.599+00:00"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
{"t":{"$date":"2023-10-27T20:55:35.880+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.1:60108","connectionId":1,"connectionCount":1}}
{"t":{"$date":"2023-10-27T20:55:35.880+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.1:60110","connectionId":2,"connectionCount":2}}
{"t":{"$date":"2023-10-27T20:55:35.886+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn2","msg":"client metadata","attr":{"remote":"172.26.0.1:60110","client":"conn2","doc":{"driver":{"name":"mongo-java-driver|sync","version":"4.6.1"},"os":{"type":"Linux","name":"Linux","architecture":"amd64","version":"6.2.0-35-generic"},"platform":"Java/Private Build/17.0.8.1+1-Ubuntu-0ubuntu122.04"}}}
{"t":{"$date":"2023-10-27T20:55:35.886+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn1","msg":"client metadata","attr":{"remote":"172.26.0.1:60108","client":"conn1","doc":{"driver":{"name":"mongo-java-driver|sync","version":"4.6.1"},"os":{"type":"Linux","name":"Linux","architecture":"amd64","version":"6.2.0-35-generic"},"platform":"Java/Private Build/17.0.8.1+1-Ubuntu-0ubuntu122.04"}}}
{"t":{"$date":"2023-10-27T20:55:35.908+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.1:60118","connectionId":3,"connectionCount":3}}
{"t":{"$date":"2023-10-27T20:55:35.910+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn3","msg":"client metadata","attr":{"remote":"172.26.0.1:60118","client":"conn3","doc":{"driver":{"name":"mongo-java-driver|sync","version":"4.6.1"},"os":{"type":"Linux","name":"Linux","architecture":"amd64","version":"6.2.0-35-generic"},"platform":"Java/Private Build/17.0.8.1+1-Ubuntu-0ubuntu122.04"}}}
{"t":{"$date":"2023-10-27T20:55:35.921+00:00"},"s":"I",  "c":"ACCESS",   "id":20249,   "ctx":"conn3","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-256","speculative":true,"principalName":"unifi","authenticationDatabase":"unifi","remote":"172.26.0.1:60118","extraInfo":{},"error":"AuthenticationFailed: SCRAM authentication failed, storedKey mismatch"}}
{"t":{"$date":"2023-10-27T20:55:35.922+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn3","msg":"Connection ended","attr":{"remote":"172.26.0.1:60118","connectionId":3,"connectionCount":2}}
{"t":{"$date":"2023-10-27T20:55:35.925+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn2","msg":"Interrupted operation as its client disconnected","attr":{"opId":104}}
{"t":{"$date":"2023-10-27T20:55:35.926+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn2","msg":"Connection ended","attr":{"remote":"172.26.0.1:60110","connectionId":2,"connectionCount":1}}
{"t":{"$date":"2023-10-27T20:55:36.427+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.1:60126","connectionId":4,"connectionCount":2}}
{"t":{"$date":"2023-10-27T20:55:36.427+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn4","msg":"client metadata","attr":{"remote":"172.26.0.1:60126","client":"conn4","doc":{"driver":{"name":"mongo-java-driver|sync","version":"4.6.1"},"os":{"type":"Linux","name":"Linux","architecture":"amd64","version":"6.2.0-35-generic"},"platform":"Java/Private Build/17.0.8.1+1-Ubuntu-0ubuntu122.04"}}}
{"t":{"$date":"2023-10-27T20:55:36.429+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.1:60130","connectionId":5,"connectionCount":3}}
{"t":{"$date":"2023-10-27T20:55:36.429+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn5","msg":"client metadata","attr":{"remote":"172.26.0.1:60130","client":"conn5","doc":{"driver":{"name":"mongo-java-driver|sync","version":"4.6.1"},"os":{"type":"Linux","name":"Linux","architecture":"amd64","version":"6.2.0-35-generic"},"platform":"Java/Private Build/17.0.8.1+1-Ubuntu-0ubuntu122.04"}}}
{"t":{"$date":"2023-10-27T20:55:36.436+00:00"},"s":"I",  "c":"ACCESS",   "id":20249,   "ctx":"conn5","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-256","speculative":true,"principalName":"unifi","authenticationDatabase":"unifi","remote":"172.26.0.1:60130","extraInfo":{},"error":"AuthenticationFailed: SCRAM authentication failed, storedKey mismatch"}}
{"t":{"$date":"2023-10-27T20:55:36.437+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn5","msg":"Connection ended","attr":{"remote":"172.26.0.1:60130","connectionId":5,"connectionCount":2}}
{"t":{"$date":"2023-10-27T20:55:36.437+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn4","msg":"Interrupted operation as its client disconnected","attr":{"opId":115}}
{"t":{"$date":"2023-10-27T20:55:36.437+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn4","msg":"Connection ended","attr":{"remote":"172.26.0.1:60126","connectionId":4,"connectionCount":1}}
{"t":{"$date":"2023-10-27T20:55:36.940+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.1:60140","connectionId":6,"connectionCount":2}}
{"t":{"$date":"2023-10-27T20:55:36.940+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn6","msg":"client metadata","attr":{"remote":"172.26.0.1:60140","client":"conn6","doc":{"driver":{"name":"mongo-java-driver|sync","version":"4.6.1"},"os":{"type":"Linux","name":"Linux","architecture":"amd64","version":"6.2.0-35-generic"},"platform":"Java/Private Build/17.0.8.1+1-Ubuntu-0ubuntu122.04"}}}
{"t":{"$date":"2023-10-27T20:55:36.941+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.1:60142","connectionId":7,"connectionCount":3}}
{"t":{"$date":"2023-10-27T20:55:36.942+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn7","msg":"client metadata","attr":{"remote":"172.26.0.1:60142","client":"conn7","doc":{"driver":{"name":"mongo-java-driver|sync","version":"4.6.1"},"os":{"type":"Linux","name":"Linux","architecture":"amd64","version":"6.2.0-35-generic"},"platform":"Java/Private Build/17.0.8.1+1-Ubuntu-0ubuntu122.04"}}}
{"t":{"$date":"2023-10-27T20:55:36.948+00:00"},"s":"I",  "c":"ACCESS",   "id":20249,   "ctx":"conn7","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-256","speculative":true,"principalName":"unifi","authenticationDatabase":"unifi","remote":"172.26.0.1:60142","extraInfo":{},"error":"AuthenticationFailed: SCRAM authentication failed, storedKey mismatch"}}
{"t":{"$date":"2023-10-27T20:55:36.949+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn7","msg":"Connection ended","attr":{"remote":"172.26.0.1:60142","connectionId":7,"connectionCount":2}}
{"t":{"$date":"2023-10-27T20:55:36.949+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn6","msg":"Interrupted operation as its client disconnected","attr":{"opId":126}}
{"t":{"$date":"2023-10-27T20:55:36.949+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn6","msg":"Connection ended","attr":{"remote":"172.26.0.1:60140","connectionId":6,"connectionCount":1}}
github-actions[bot] commented 8 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.

thespad commented 8 months ago

From the error it looks like you're not following the instruction to URL encode your password.

mtihlenfield commented 8 months ago

ah ok I didn't realize that would need to be done for FILE__ variables. I will give that a try

mtihlenfield commented 8 months ago

Unless you mean the password itself needs to be URL encoded? To test I'm just using password, so I think it should be fine?

thespad commented 8 months ago

Yes, the password itself, but if it's only alphanumeric that's obviously not a factor.

What is the output of cat ./secrets/unifi_mongodb_password.txt?

mtihlenfield commented 8 months ago

This:

$ cat ./secrets/unifi_mongodb_password.txt                                                                                                                      130 ↵
password
thespad commented 8 months ago

I suspect you have a trailling newline in your secret file and as a result your password is being set to a blank string

mtihlenfield commented 8 months ago

Just double checked and did not find a trailing newline.

Am I correct in thinking that the MONGO_PASS variable should show up here, even if set to a blank string?

$ docker exec unifi env | grep MONGO
FILE__MONGO_PASS=/run/secrets/unifi_mongodb_password
MONGO_HOST=localhost
MONGO_PORT=27017
MONGO_DBNAME=unifi
MONGO_USER=unifi
thespad commented 8 months ago

No, if it's blank it won't show as a set variable

thespad commented 8 months ago

To demonstrate

$ echo -n test > testfile
$ cat testfile
test$
$ echo test > testfile
$ cat testfile
test
$
thespad commented 8 months ago

The former will work, the latter will give you a blank env

mtihlenfield commented 8 months ago

ok I see. Well currently both password files contain nothing but password, no newlines or any other special characters. Also I'm using the same secret file to create the unifi user in the database and it is working there. I can log in to the database using the username/password created from the secret file. With the compose file running this will work:

docker run -it --rm --net=host mongo \
        mongosh --host 127.0.0.1 \
                -u unifi \
                -p password \
                --authenticationDatabase unifi \
                unifi
thespad commented 8 months ago

I've no idea what logic the mongo container uses for parsing secrets, I can only speak for our images.

mtihlenfield commented 8 months ago

Totally understand. I just thought it might be a useful data point.

thespad commented 8 months ago

All I can say is that to date, every single time we have had someone report an issue with secrets not being applied in one of our containers, it's been because of incorrect formatting of the file.

mtihlenfield commented 8 months ago

For good measure I just regenerated the file by doing this:

$ echo "password" > ./secrets/unifi_mongodb_password.txt 
$ md5sum ./secrets/unifi_mongodb_password.txt
286755fad04869ca523320acce0dc6a4  ./secrets/unifi_mongodb_password.txt

and that didn't solve the issue.

mtihlenfield commented 8 months ago

Welp you were right! I don't know where the \n came from, but I looked at the /proc/<pid>/environ file for the unifi server process and there it was. Sorry for taking up your time and thanks for your work on the container.