-
-
Notifications
You must be signed in to change notification settings - Fork 57
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] Defined MONGO_HOST is not reachable, cannot proceed. #42
Comments
Have you confirmed your mongo db container is running correctly? |
It does not seem to be any issue there at least from the logs. Mongo DB Logs
|
If you restart the unifi container after my mongodb has started up, does it work? |
That is something which came to my mind too once I got to the thread where this topic was discussed. Tried that and did not helped and it did not help with the config above as well. Still the same error in unifi-app log |
I also checked the password special characters thread, so I made sure the password for MongoDB only includes upper and lower case alphabet characters and numbers to prevent some encoding problems. |
I'm having the exact same issue and seem to have done everything correctly. |
Same issue here, when trying to setup the new container to ensure I can keep moving forward with updates in 2024. The whole MongonDB thing makes little sense currently how to get it work with this new Unifi docker stuff. |
I had the same issue but got it working with the following ---
version: "2.1"
services:
unifi-network-application:
image: lscr.io/linuxserver/unifi-network-application:latest
container_name: unifi-network-application
depends_on:
- unifi-db
environment:
- PUID=1026
- PGID=101
- TZ=Europe/Amsterdam
- MONGO_USER=unifi
- MONGO_PASS=unifi
- 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:
- ./config:/config
ports:
- 3478:3478/udp # Unifi STUN port
- 10001:10001/udp # Required for AP discovery
- 8080:8080 # Required for device communication
- 8081:8081
- 8443:8443 # Unifi web admin port
# - 1900:1900/udp # optional Required for Make controller discoverable on L2 network option
- 8843:8843 # Unifi guest portal HTTPS redirect port
- 8880:8880 # Unifi guest portal HTTP redirect port
- 6789:6789 # For mobile throughput test
- 5514:5514/udp # optional Remote syslog port
restart: unless-stopped
unifi-db:
# WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
image: docker.io/mongo:4
container_name: unifi-db
volumes:
- ./mongodb/data:/data/db
- ./mongodb/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 10s
retries: 5
start_period: 20s
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_stat"}]}) And I imported a backup from my old 7.3 controller, it seems to work fine. |
That just worked for me, thanks a lot! |
So you just replaced the password and that is it? |
Sorry, I meant the password in the |
Hi thanx, so far not much successful. I noticed only (correct me if I am wrong) 4 differences you have in you compose file comparing to mine.
|
So I tested all above and did not get into any working solution. I am still on the same MongoDB not reachable. |
Gave up trying. This pushed me to investigate installation of the app natively on RPi4. And to my surprise it went flawlessly. It took around 2 minutes. |
Same, but I tried this instead, works well! |
Is it possible to connect to a standalone instance of mongodb? how? |
yes it is possible, but I believe it is not scope of this repo. |
I've found that the standalone instance is not reachable too,it's confusing |
this solution worked for me as well. One thing that might not be obvious is that the author has put both mongo and unifi network manager in the same docker compose so you dont need to start another docker container which is what I was attempting to do previously. Also, i recommend starting the container the first time with out -d e.g. |
A bit late to the party, but seeing you are using Synology, perhaps you have enabled Firewall? This thing does pretty good job at stopping incoming connections even when containers are on the same subnet. Select your |
Hi @Xeevis good catch. It did the trick. It did not came to my mind as I am having similar setup for other application (two containers deployed from one docker compose file in Portainer using default bridged network settings). It is not allowed in Synology Firewall, but it works, both containers are communicating on the same network. So, I freshly deployed the |
Glad you got it working👍. Docker implementation by Synology sometimes works in strange ways. Bridged network might be whitelisted by default while custom networks are unknown to the code and firewall won't permit any cross-container communication. Also watch out for changing IPs, just stopped/started stack in Portainer and it recreated the network and changed the subnet IP. |
Good to know definitely for other Docker deployments on Synology as well 👍. Anyway, I gave up on this setup and transitioned to RPi4 install. Btw not easy too, as you need to figure out yourself that it won't work on MongoDB 4.4.19 and higher due to processor requirements. Now waiting for my UDM-SE device, so will drop the RPi4 install as well. |
AVX support is a requirement from MongoDB 5.0+ and as stated in README.md formally only mongodb 3.6 through 4.4 are supported by this repository, so it shouldn't be an issue for the time being. UDM is one way to solve this, but quite pricey too and I'm not aware of any benefits for SOHO application where I have couple Lite APs, PoE switches and UXG-Lite gateway. |
I am aware about AVX requirement for MongoDB 5.0+. But there seems to be also ARMv8.2-A requirement for mongo 4.4.19 and higher. That is why 4.4.18 version is the last one working on RPi4. It is also mentioned here #4. You are of course right mentioning only the small benefits of using UDM in SOHO application, it is a matter of personal preference. |
I also got it working. Thanks to Xeevis. That is the Synology Firewall problem. |
Glad to know I am not the only one having this issue. |
Is there an existing issue for this?
Current Behavior
Hello, I am trying to migrate from Controller which will be EOL in Jan 2024 to this new version and I am having following error
*** Defined MONGO_HOST unifi-db is not reachable, cannot proceed. ***
in the unifi-app container log. unifi-db is running just fine no errors in the log -> user, DBs etc created just fine. Web UI on https://ip:8443 gives "This site can’t be reached" ERR_CONNECTION_CLOSED.docker-compose.yml
andinit-mongo.js
files below. I browsed all the issues back and forth and could not get into any working config for me. Any ideas what I am doing wrong?docker-compose.yml file
init-mongo.js
Expected Behavior
unif-app conects to unifi-db and Web-UI is loaded.
Steps To Reproduce
*** Defined MONGO_HOST unifi-db is not reachable, cannot proceed. ***
in container Logs.Environment
CPU architecture
x86-64
Docker creation
Used App Template deploy in Portainer 2.19.3 EE.
Container logs
The text was updated successfully, but these errors were encountered: