I
Immich2y ago
Alex

v1.81 ECONNREFUSED 172.18.0.6:3001

After updating to 1.81 I get ECONNREFUSED on server UI . I am using external db postgre v 15.2. v1.77-1.80 worked well with this DB and settings in env and copose files. I see similar ECONNREFUSED issue, but it seems that it's connected with typesene, not server or microservices services. https://discord.com/channels/979116623879368755/1049703391762321418/threads/1157287434481057844
No description
15 Replies
Alex Tran
Alex Tran2y ago
What is the current version of your external postgres now?
Alex
AlexOP2y ago
15.2. Right now I suspect that problem is in docker, not immich. ping host.docker.internal returns invalid IP.
Alex Tran
Alex Tran2y ago
Try reatart the vm or docker engine
Alex
AlexOP2y ago
I have this in compose. extra_hosts: - "host.docker.internal:host-gateway". Ping shouldf return my local ip, but return default docker network ip
Alex Tran
Alex Tran2y ago
Is there any reason you add this line?
Alex
AlexOP2y ago
As far as I understand host.docker.internal is not available by default. Also I changed env file for this DB_HOSTNAME=host.docker.internal.
Alex Tran
Alex Tran2y ago
Hmmmmm Is this the new edit or you have made it work before?
Alex
AlexOP2y ago
It worked 1.77-1.80. Seems docker failed. WSL crashed and I have to reset to factory defaults. Need som time to restore prev settings.
Alex Tran
Alex Tran2y ago
I highly suggest to use the included database service in the compose file. So that everything is isolated on application level. The overhead is minimal so you shouldn't be worry about it
Alex
AlexOP2y ago
Finally I gave up and use included db service. Don't understand what has broken. Installed ping, telnet, pg client on server container. Ping host.docker.internal works, telnet host.docker.internal 5432, pg_isready -d immich -h host.docker.internal -p 5432 -U immich works. But immich still can't connect to local db server. The goal of using local pg server was that it alredy runs on my server. Managment and backup is easier. By the way, docker exec -t immich_postgres pg_dumpall -c -U postgres | gzip > "d:\Backups\immich.dump.gz" which is described on help page doesn't work on Windows: Gzip is unknown. I used -f instead of gzip, in such case another issue, see screenshot.
No description
Alex
AlexOP2y ago
Hello @Alex. Could you please check if DB_USERNAME, DB_PASSWORD, DB_DATABASE_NAME are actually taken from ENV file and not some defaults hardcoded for microservice and server?
Alex Tran
Alex Tran2y ago
I am pretty positive it is. What problem are you facing with?
Alex
AlexOP2y ago
I want to return to my local postgres because of backup/restore pain in container. I can backup but restore don't work. Script in backup file not executes. So I tried to setup env to my local postgres. I set all params in env and see that something changed: intead of econnrefused from my first messsage for 1.81 now i get athorization error on 1.82.1. In same time I can login with this credetials locally. But if I comment all that DB variable in env file, I acpect that according to docementation defaults are used. But in this case I get Error: Config validation error: "DB_USERNAME" is required. "DB_DATABASE_NAME" is required 2023-10-21 21:41:24 at ConfigModule.forRoot (/usr/src/app/node_modules/@nestjs/config/dist/config.module.js:78:23) 2023-10-21 21:41:24 at Object.<anonymous> (/usr/src/app/dist/infra/infra.module.js:45:27) Also I tried to publish container postgres with ports: - 5433:5432. And I can't connect from my local server to container postgres with login set in enf file. So my idea was that somewhere login pass is not loaded. Or may be permissions in postgres container doesn't allow to connect over published port.
Alex Tran
Alex Tran2y ago
Can you describe your setup?
Alex
AlexOP2y ago
Win 10, docker v4.24.2 . Docker subnet 192.168.65.0/24, local server 192.168.39.10. Local PostgreSQL v15.2. pg_hba is: local replication all scram-sha-256 host replication all 127.0.0.1/32 scram-sha-256 host replication all ::1/128 scram-sha-256 host all all 192.168.39.1/24 scram-sha-256 host all all 192.168.65.1/24 scram-sha-256 Tried different configs of ENV/docker compose: 1. when try to use my local postgre sql DB_PASSWORD=somepass DB_HOSTNAME=host.docker.internal DB_PORT=5432 DB_USERNAME=immich DB_DATABASE_NAME=immich remove database service(container) section, remove depends_on:- database for immich-microservices, immich-server 2. when use "your" database service DB_PASSWORD=somepass DB_USERNAME=postgres DB_DATABASE_NAME=immich add ports: - 5433:5432

Did you find this page helpful?