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

no more login to docker unifi-network-application with mongo db #101

Closed
1 task done
shredman01 opened this issue Jul 25, 2024 · 5 comments
Closed
1 task done

no more login to docker unifi-network-application with mongo db #101

shredman01 opened this issue Jul 25, 2024 · 5 comments

Comments

@shredman01
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I migrated from unifi controller 8.0.24 to 8.2.93 or latest version of docker unifi-networking-application. I followed the instructions exactly and imported a previously created backup of the old controller after starting the container for the first time. Everything is ok so far, but I can only log in for a few hours and then nothing works. Incorrect user or password. The server.log file is full of strange error messages. when these messages come up in the log, login is not possible anymore.

Expected Behavior

I've tried all sorts of mongo db versions, different unifi docker tags but always the same. Migration successful and after a few hours of operation the web interface no longer lets me log in. I probably have to go back to the unifi-controller version, which doesn't get any updates anymore but at least it works. What could be the cause?

Steps To Reproduce

see current behavior

Environment

- OS: 
dPRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian

Hardware: Intel Product Name: NUC12WSBi3

services:

  unifi-db:
    image: mongo:5.0
    container_name: unifi-db
    hostname: mongo-unifi
    mem_limit: 2g
    ports:
      - 27017:27017
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
       - /data/docker/container/unifi-network/mongo:/data/db:rw
       - /data/docker/container/unifi-network/mongo:/var/lib/mongo:rw
       - /data/docker/container/unifi-network/mongo:/data/configdb:rw
       - /data/docker/container/unifi-network/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
    #command: [ --auth ]
    restart: unless-stopped

  unifi-network-application:
    image: lscr.io/linuxserver/unifi-network-application:8.2.93
    container_name: unifi-network-application
    depends_on:
      - unifi-db
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - MONGO_USER=unifi
      - MONGO_PASS=password123
      - MONGO_HOST=mongo-unifi
      - MONGO_PORT=27017
      - MONGO_DBNAME=unifi
      - MEM_LIMIT=1024
      - MEM_STARTUP=1024
      - MONGO_TLS=false
      #- MONGO_AUTHSOURCE= unifi 
    volumes:
      - /data/docker/container/unifi-network/config:/config
    ports:
     - '3478:3478/udp'
     - '10001:10001/udp'
       #- '1900:1900/udp'
     - '6789:6789/tcp'
     - '9080:8080/tcp'
     - '8880:8880/tcp'
     - '9443:8443/tcp'
     - '8843:8843/tcp'
     - '5514:5514/tcp'

db.getSiblingDB("admin").createUser({user: "admin", pwd: "password", roles: [{role: "userAdminAnyDatabase", db: "admin"}]});
db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "password123", roles: [{role: "readWrite", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "password123", roles: [{role: "readWrite", db: "unifi_stat"}]});

CPU architecture

x86-64

Docker creation

normal with docker compose up -d

Container logs

unifi-networking-application logs:

[2024-07-25 18:21:07,233] <inform_stat-2> ERROR uap    - inconsistent vap, offending essid=shredman_guest
[2024-07-25 18:21:07,233] <inform_stat-2> WARN  uap    - invalid id (5b2006351c71283b15f425dd) in vap, searching by essid=shredman_wlan in site 5b2000d81c71283b15f425c6
[2024-07-25 18:21:07,234] <inform_stat-2> ERROR uap    - inconsistent vap, offending essid=shredman_wlan
[2024-07-25 18:21:07,234] <inform_stat-2> WARN  uap    - invalid id (5be72e1c3cdd3502e1011de1) in vap, searching by essid=shredman_radius in site 5b2000d81c71283b15f425c6
[2024-07-25 18:21:07,235] <inform_stat-2> ERROR uap    - inconsistent vap, offending essid=shredman_radius
[2024-07-25 18:21:07,235] <inform_stat-2> WARN  uap    - invalid id (5da2382b3cdd35031b3afbeb) in vap, searching by essid=RaidbossGER in site 5b2000d81c71283b15f425c6
[2024-07-25 18:21:07,235] <inform_stat-2> ERROR uap    - inconsistent vap, offending essid=RaidbossGER
[2024-07-25 18:21:17,356] <inform_stat-3> WARN  uap    - invalid id (5ee9122b3cdd35324a33b6d0) in vap, searching by essid=element-2cb7dd835fcfc0da in site 5b2000d81c71283b15f425c6


mongo-db logs:

{"t":{"$date":"2024-07-25T16:28:27.904+00:00"},"s":"I",  "c":"ACCESS",   "id":20250,   "ctx":"conn606","msg":"Authentication succeeded","attr":{"mechanism":"SCRAM-SHA-256","speculative":true,"principalName":"unifi","authenticationDatabase":"unifi","remote":"172.30.3.3:48912","extraInfo":{}}}
{"t":{"$date":"2024-07-25T16:28:38.267+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":"[1721924918:267107][1:0x7fd93083f700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 7208, snapshot max: 7208 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 802"}}
{"t":{"$date":"2024-07-25T16:29:38.275+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":"[1721924978:275477][1:0x7fd93083f700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 7210, snapshot max: 7210 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 802"}}
{"t":{"$date":"2024-07-25T16:30:38.282+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"Checkpointer","msg":"WiredTiger message","attr":{"message":"[1721925038:282100][1:0x7fd93083f700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 7213, snapshot max: 7213 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 802"}}
{"t":{"$date":"2024-07-25T16:31:27.897+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn602","msg":"Connection ended","attr":{"remote":"172.30.3.3:45282","uuid":"e2f4193a-ef3e-49ac-bed0-82248591ed06","connectionId":602,"connectionCount":6}}
Copy link

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

@brandorian
Copy link

did you find a solution? i have the same issue!

@shredman01
Copy link
Author

shredman01 commented Aug 22, 2024

No, not really. I tried everything, multiple installations with different mongo-db versions, docker-compose.yml settings but nothing worked. The container runs smoothly at the beginning, you can log in, everything is ok, but after a few hours nothing works anymore. No possibility to log in anymore. I suspect it's a problem with the separate mongodb database. Hopefully the Github team will take a closer look at this error. I'm still on the latest unifi-controller docker version, which at least runs stable.

@shredman01
Copy link
Author

shredman01 commented Aug 25, 2024

did you find a solution? i have the same issue!

Solution found, everything works now. I looked at the github page https://github.com/linuxserver/docker-unifi-network-application again and saw that the initialization of the mongo db is no longer done with the init-mongo.js script but with an init-mongo.sh script. Important! First, delete the content of the database and the config directory. Then, create the init-mongo.sh script as described in the HowTo, set u+x, build a suitable docker-compose.yml and start the containers with docker compose up -d and it should work.
Logs can be checked with a docker logs -f unifi-network-application

services:

unifi-db:
image: mongo:6.0.16
container_name: unifi-db
hostname: mongo-unifi
mem_limit: 2g
environment:
- TZ=Europe/Berlin
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=mypassword
- MONGO_USER=unifi
- MONGO_PASS=otherpassword
- MONGO_DBNAME=unifi
- MONGO_AUTHSOURCE=admin
- MEM_LIMIT=1024
- MEM_STARTUP=1024
- MONGO_TLS=false
networks:
default:
ipv4_address: 172.25.1.2
ports:
- 27017:27017
volumes:
- /data/docker/container/unifi-network/mongo:/data/db:rw
- /data/docker/container/unifi-network/mongo:/var/lib/mongo:rw
- /data/docker/container/unifi-network/mongo:/data/configdb:rw
- /data/docker/container/unifi-network/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
depends_on:
- unifi-db
environment:
- PUID=1000
- PGID=1000
- MONGO_HOST=172.25.1.2
- MONGO_PORT=27017
- MONGO_USER=unifi
- MONGO_PASS=otherpassword
- MONGO_DBNAME=unifi
- MONGO_AUTHSOURCE=admin
volumes:
- /data/docker/container/unifi-network/config:/config
networks:
default:
ipv4_address: 172.25.1.3
ports:
- '3478:3478/udp'
- '10001:10001/udp'
#- '1900:1900/udp'
- '6789:6789/tcp'
- '9080:8080/tcp'
- '8880:8880/tcp'
- '9443:8443/tcp'
- '8843:8843/tcp'
- '5514:5514/tcp'

networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.25.1.0/24
driver_opts:
com.docker.network.bridge.name: br_unifi

The docker conatiners run since 2 days and login is possible every time.

Regards,
Frank

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@drizuid drizuid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants