-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
[BUG] Can't start application by following README.md precisely #84
Comments
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid. |
My guess is, either your Most of our team members use unifi. We all followed the readme and I assure you it works. |
@aptalca thanks for your reply! db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}]});
db.getSiblingDB("MONGO_DBNAME_stat").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME_stat"}]}); As I pointed out at issue description, I'm using clean Ubuntu install and building containers in a new directory from zero. If I make any changes to docker-compose config, I delete mapped volumes, execute
you mean what? |
@1shindes had this problem as well as I screwed it up the first time around. Make sure to change the values inside of the db.getSiblingDB("unifi").createUser({user: "unifi-user", pwd: "password1234", roles: [{role: "dbOwner", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi-user", pwd: "password1234", roles: [{role: "dbOwner", db: "unifi_stat"}]}); Also if you did mess up the first time around I would prune any volumes that are not used with |
@kylemello Thanks! By the time I received your reply I've found it myself. docker-compose.yml---
services:
unifi-db:
hostname: unifi-db
container_name: unifi-db
image: 'mongo:7.0.5'
volumes:
- ./unifi-db/data:/data/db
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
ports:
- 27017:27017
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=unifi
- MONGO_PASS=unifipass
- MONGO_HOST=unifi-db
- MONGO_PORT=27017
- MONGO_DBNAME=unifi-db
# - MEM_LIMIT=1024 #optional
# - MEM_STARTUP=1024 #optional
# - MONGO_TLS= #optional
# - MONGO_AUTHSOURCE= #optional
volumes:
- ./unifi-network/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
depends_on:
- unifi-db
init-mongo.jsdb.getSiblingDB("unifi-db").createUser({user: "unifi", pwd: "unifipass", roles: [{role: "dbOwner", db: "unifi-db"}]});
db.getSiblingDB("unifi-db_stat").createUser({user: "unifi", pwd: "unifipass", roles: [{role: "dbOwner", db: "unifi-db_stat"}]}); That's it! No |
So in other words, you did not follow the readme precisely as the readme states Glad it's solved. |
It's worth noting that if something gets messed up with the database initialization and you're trying to recreate the containers you must clear out BOTH the mongodb data AND the unifi config folders. I initially didn't escape special characters in the password. I figured that part out pretty quickly and corrected it but only cleared out the mongodb data folder before recreating the containers thinking the unifi config would read an updated password specified in the compose file. That stymied me for a bit because the unifi app was still failing to authorize against the mongodb instance. I finally realized I should try clearing out everything before recreating the containers and that did the trick. Might be worth adding a small blurb to the README about making sure absolutely all the persistent volumes are cleared out if you are trying to start over after a failed initialization. |
Maybe I just missed it in the docs, but I had the exact same issue because I used a password longer than 32 chars. |
Also, that |
I just spent a few hours getting this to work, the command in the README for 6.x does not work. You will not be able to auth against the |
/### Is there an existing issue for this?
Current Behavior
Trying to start me the docker-unifi-network-application following README.md precisely using docker-compose and the
following config:
Database wasn't initialized
Hence the application doesn't start up properly.
I can create mongo-express container additionally, manually create unifi user, unifi/unifi_stat database etc., restart the application container only and then, if did it all right, succeed.
But this means that the instructions from README are not correct for my system setup, at least, and maybe they have to be updated.
Is it even possible to, with proper yaml file, start up docker-unifi-network-application from scratch or it's just me doing all wrong?
Expected Behavior
App should be working
Steps To Reproduce
Environment
CPU architecture
x86-64
Docker creation
as per yaml config
Container logs
The text was updated successfully, but these errors were encountered: