Closed darkra66it closed 1 year ago
So you have any networking things going on? If your run docker compose up database redis do they come up correctly?
So you have any networking things going on? If your run docker compose up database redis do they come up correctly?
I'm new to Docker / Docker networking so not sure where to start troubleshooting.
ubuntu@immich-ubuntu-arm64:~/immich-app$ sudo docker compose up -d [+] Running 9/9 ✔ Network immich-app_default Created 0.0s ✔ Container immich_web Started 0.9s ✔ Container immich_redis Started 0.8s ✔ Container immich_typesense Started 1.0s ✔ Container immich_machine_learning Started 0.8s ✔ Container immich_postgres Started 0.4s ✔ Container immich_microservices Started 1.5s ✔ Container immich_server Started 1.4s ✔ Container immich_proxy Started 1.8s
From searching around, my guess is that there is something blocking the inter-container traffic?
immich_server | [Nest] 7 - 10/18/2023, 10:51:04 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (9)... immich_server | Error: connect EHOSTUNREACH 172.21.0.2:5432 immich_server | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) immich_server | [Nest] 7 - 10/18/2023, 10:51:04 PM ERROR [ExceptionHandler] connect EHOSTUNREACH 172.21.0.2:5432 immich_server | Error: connect EHOSTUNREACH 172.21.0.2:5432 immich_server | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) immich_microservices | Error: connect EHOSTUNREACH 172.21.0.3:6379 immich_microservices | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) { immich_microservices | errno: -113, immich_microservices | code: 'EHOSTUNREACH', immich_microservices | syscall: 'connect', immich_microservices | address: '172.21.0.3', immich_microservices | port: 6379 immich_microservices | }
Ok, I've been able to resolve this -- it appears that installing docker using snap
is a bad idea.
I ran sudo snap remove docker --purge
to wipe it out completely. Then I installed docker via https://docs.docker.com/engine/install/ubuntu/ and rebuilt everything from scratch.
sudo docker compose up -d
now works as expected, I can login and start experimenting.
I had the same issue when installing Immich with docker-compose on my Synology NAS. Guess it is related to the firewall issues mentioned above. A restart of the NAS seems to have fixed it (only disabling and re-enabling the firewall did not work).
Can anybody explain why this happens? It also only happens with Immich, and it happened on all my tries consistently
I'm running a ubuntu server, with a lot of containers working fine, but I'm getting this message when running immich stack (portainer compose or terminal). I've tried to use a db server that I use for other apps, but changing that didn't help. Any ideias what might be blocking this?
Thanks @Devqon , it's indeed a firewall issue.
For anyone who's using Immich on Synology NAS, rather than turning off firewall entirely, you need to allow the immich_default
network subnet to access other ports through the firewall. (You may use more specific ports to make it more secure.)
immich_default
and write down the subnet. Subnet
immich_default
subnet value without /16
255.255.0.0
Please see my rules as an example.
Thanks @Devqon , it's indeed a firewall issue.
For anyone who's using Immich on Synology NAS, rather than turning off firewall entirely, you need to allow the
immich_default
network subnet to access other ports through the firewall. (You may use more specific ports to make it more secure.)1. Build the Immich docker compose project 2. Go to Container Manger -> Network -> expand `immich_default` and write down the subnet. 3. Go to Control Panel -> Security -> Firewall -> Edit Rules 4. Add a new rule * Ports: All * Source IP: Specific IP * Choose `Subnet` * IP address: the `immich_default` subnet value without `/16` * Subnet mask: `255.255.0.0` * Action: Allow * save the rules
Please see my rules as an example.
Confirm as a fix. Seen people asking about this for ages well done
The bug
Using almost-vanilla configuration as per the wiki, I've not been able to get this deployed via the docker compose method.
When checking container status, immich_server and immich_microservices are crashing/restarting constantly, so I'm not able to access the web portal.
Diving deeper, the docker logs for immich_server and immich_microservices show connection timeouts for both the redis and postgres DB (but mostly the redis) like:
[Nest] 7 - 10/18/2023, 8:22:58 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (8)... Error: Connection terminated due to connection timeout at Connection. (/usr/src/app/node_modules/pg/lib/client.js:132:73)
at Object.onceWrapper (node:events:628:28)
at Connection.emit (node:events:514:28)
at Socket. (/usr/src/app/node_modules/pg/lib/connection.js:63:12)
at Socket.emit (node:events:514:28)
at TCP. (node:net:337:12)
Error: connect EHOSTUNREACH 172.18.0.6:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
errno: -113,
code: 'EHOSTUNREACH',
syscall: 'connect',
address: '172.18.0.6',
port: 6379
}
Checking logs for redis, last message "ready to accept connections"
Checking logs for postgres, last message: "database system is ready to accept connections"
The OS that Immich Server is running on
Ubuntu 18.04 ARM64
Version of Immich Server
latest
Version of Immich Mobile App
n/a
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Additional information
No response