Closed Schmandre closed 7 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.
seems that there was an issue regarding docker compose. Working now. Closed
I ran into this issue and it was caused by specifying MONGO_INITDB_ROOT_*
env vars. I didn't use the init script as I handle the initialisation with ansible instead so I would've expected the root variables to work. I haven't quite worked out why unifi errors when these values are set, even though the database is in the correct configuration.
Thanks @RobertYoung, this tripped me up for awhile. I'm unsure why removing this env var from the mongo-db container has any impact on the unifi-network-application container since I did it well after the DB initialized the first time.
For me, this was a permissions issue in the DB. So to fix it, I did:
oc exec -it unifi-db-749b7875f5-wh9bw -- mongosh -u unifi -p unifi
test> use unifi
unifi> db.grantRolesToUser( "unifi", [{ role: "dbOwner", db: "unifi" }] )
unifi> db.grantRolesToUser( "unifi", [{ role: "dbOwner", db: "unifi_stat" }] )
Now the application starts up without the error.
Hi, I'm reopening this issue as I too have this problem:
[migrations] started
[migrations] no migrations found
───────────────────────────────────────
██╗ ███████╗██╗ ██████╗
██║ ██╔════╝██║██╔═══██╗
██║ ███████╗██║██║ ██║
██║ ╚════██║██║██║ ██║
███████╗███████║██║╚██████╔╝
╚══════╝╚══════╝╚═╝ ╚═════╝
Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID: 1000
User GID: 1000
───────────────────────────────────────
[custom-init] No custom files found, skipping...
Exception in thread "launcher" java.lang.NullPointerException: Web context failed to initialize
at java.base/java.util.Objects.requireNonNull(Objects.java:235)
at com.ubnt.net.OoOO.õÓ0000(Unknown Source)
at com.ubnt.net.OoOO.ÕÒ0000(Unknown Source)
at com.ubnt.service.C.øÓ0000(Unknown Source)
at com.ubnt.ace.Launcher.String(Unknown Source)
at com.ubnt.ace.Launcher.main(Unknown Source)
version: '3.8'
services:
unifi-db:
networks:
- blackhole
hostname: unifi-db
container_name: unifi-db
image: mongo:latest
environment:
MONGO_INITDB_DATABASE: unifi
MONGO_INITDB_ROOT_USERNAME: mongo
MONGO_INITDB_ROOT_PASSWORD: mongopassword
volumes:
- /mnt/storage/unifi-db/data:/data/db
- /mnt/storage/unifi-db/scripts/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
ports:
- 27017:27017
restart: unless-stopped
unifi-express:
networks:
- blackhole
hostname: unifi-express
container_name: unifi-express
image: mongo-express:latest
ports:
- 8081:8081
depends_on:
- unifi-db
environment:
ME_CONFIG_MONGODB_SERVER: unifi-db
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_MONGODB_ADMINUSERNAME: mongo
ME_CONFIG_MONGODB_ADMINPASSWORD: mongopassword
ME_CONFIG_BASICAUTH_USERNAME: express
ME_CONFIG_BASICAUTH_PASSWORD: expresspassword
restart: unless-stopped
unifi-network:
networks:
- blackhole
hostname: unifi-network
container_name: unifi-network
image: lscr.io/linuxserver/unifi-network-application:latest
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Rome
- MONGO_USER=unifi
- MONGO_PASS=unifi
- MONGO_HOST=unifi-db
- MONGO_PORT=27017
- MONGO_DBNAME=unifi
volumes:
- /mnt/storage/unifi-network/data:/config
ports:
- 8443:8443
- 3478:3478/udp
- 10001:10001/udp
- 8080:8080
restart: unless-stopped
depends_on:
- unifi-db
networks:
blackhole:
name: container-net
external: true
db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "unifi", roles: [{role: "dbOwner", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "unifi", roles: [{role: "dbOwner", db: "unifi"}]});
the database and user are created successfully; furthermore the database is populated with all the initial data; I attach screenshots:
but tomcat gives a 404 error and doesn't work:
how do I solve the problem?
Thank you.
The read me tells you not to mix the initjs and the env's for username creation.
solved here, ubiquiti forum
Is there an existing issue for this?
Current Behavior
The system is installed and unifi database created (checked via mongo-express ui). Unfournatly, I got a bunch of errors. So let me post step by step:
docker-compose logs -f | unifi-network-ap
After that I checked the logs under unifi_controller_new/unifi-config/logs/server.log
Extrem long output
``` [2023-11-23 10:51:36,777]If I try to reach the controller I got an HTTP Status 404 – Not Found
Expected Behavior
Webinterface should be available and working
Steps To Reproduce
docker-compose file
``` version: "2.1" services: unifi-network-application: image: lscr.io/linuxserver/unifi-network-application:latest container_name: unifi-network-application depends_on: - mongo environment: - PUID=1000 - PGID=1000 - TZ=Europe/Berlin - MONGO_USER=unifi - MONGO_PASS=unifi_pass - MONGO_HOST=192.168.0.250 - MONGO_PORT=27017 - MONGO_DBNAME=unifidb volumes: - ./unifi-config:/config ports: - 8444:8443 - 3478:3478/udp - 10001:10001/udp - 8181:8080 #- 1900:1900/udp #- 8843:8843 #- 8880:8880 #- 6789:6789 #- 5514:5514/udp dns: - 192.168.0.250 - 1.1.1.1 restart: unless-stopped links: - mongo mongo: image: mongo:4.4 container_name: mongodb restart: always ports: - 27017:27017 environment: PUID: 1000 GUID: 1000 #MONGO_INITDB_ROOT_USERNAME: root #MONGO_INITDB_ROOT_PASSWORD: unifi_pass volumes: - ./mongo/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro - ./mongo/data:/data mongo-express: image: mongo-express container_name: mongo-web restart: always links: - mongo ports: - 8881:8081 environment: ME_CONFIG_MONGODB_SERVER: mongodb ME_CONFIG_BASICAUTH_USERNAME: unifi ME_CONFIG_BASICAUTH_PASSWORD: unifi_pass ME_CONFIG_MONGODB_PORT: 27017 ME_CONFIG_MONGODB_ADMINUSERNAME: root ME_CONFIG_MONGODB_ADMINPASSWORD: unifi_pass ME_CONFIG_MONGODB_URL: mongodb://unifi:unifi_pass@localhost:27017/unifidb volumes: - ./mongo-web:/data/db ```mongodb init file
Environment
CPU architecture
x86-64
Docker creation
Container logs