server error : connect ECONNREFUSED 172.18.0.7:3001

Running proxmox with nfs share mounted to lxc container with portainer. Used: https://documentation.immich.app/docs/install/portainer To install, changed upload location to /mnt/pve/portainer (nfs location) And database to: volumes: - ${UPLOAD_LOCATION}/data:/var/lib/postgresql/data After that I get this error: connect ECONNREFUSED 172.18.0.7:3001 - ECONNREFUSED Stacktrace Error: connect ECONNREFUSED 172.18.0.7:3001 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) All I really want is to use the nfs share for the big data. Maybe I'm doing something wrong but I can't figure out what. Though it's also 5am that doesn't help 🙂
Portainer | Immich
Install Immich using Portainer's Stack feature.
91 Replies
jrasm91
jrasm913y ago
Can you upload you stack configuration and redacted .env? I'm guessing the server is not starting because of a misconfiguration, you could also look at the immich_server logs
Keyakinan
KeyakinanOP3y ago
version: "3.8" services: immich-server: container_name: immich_server image: altran1502/immich-server:release entrypoint: ["/bin/sh", "./start-server.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - stack.env environment: - NODE_ENV=production depends_on: - redis - database restart: always immich-microservices: container_name: immich_microservices image: altran1502/immich-server:release entrypoint: ["/bin/sh", "./start-microservices.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - stack.env environment: - NODE_ENV=production depends_on: - redis - database restart: always immich-machine-learning: container_name: immich_machine_learning image: altran1502/immich-machine-learning:release entrypoint: ["/bin/sh", "./entrypoint.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - stack.env environment: - NODE_ENV=production depends_on: - database restart: always immich-web: container_name: immich_web image: altran1502/immich-web:release entrypoint: ["/bin/sh", "./entrypoint.sh"] env_file: - stack.env restart: always redis: container_name: immich_redis image: redis:6.2 restart: always database: container_name: immich_postgres image: postgres:14 env_file: - stack.env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} PG_DATA: /var/lib/postgresql/data volumes: - ${UPLOAD_LOCATION}/data:/var/lib/postgresql/data restart: always
Keyakinan
KeyakinanOP3y ago
No description
Keyakinan
KeyakinanOP3y ago
oke it is def my mounted nfs share that doesn't work (but does on host)
jrasm91
jrasm913y ago
Does it work on other containers? Is this the first time using the volume in docker?
Keyakinan
KeyakinanOP3y ago
I'm not sure how I can check that? I haven't deployed anything else other then portainer with immich. It is the first time for this volume yes. But when I go into the container with sh I can create a folder and that works perfectly, I can see it on my nfs share
jrasm91
jrasm913y ago
Which container do you mean? Immich or portainer?
Keyakinan
KeyakinanOP3y ago
The server container of immich
jrasm91
jrasm913y ago
You can attach to the container and make a new directory in /usr/src/app/upload and the new folder shows up in the share?
Keyakinan
KeyakinanOP3y ago
yes exactly!
jrasm91
jrasm913y ago
I don't know if it is a problem but your mounts are kind of messed up UPLOAD_LOCATION gets mounted to the immich containers and UPLOAD_LOCATION/data is mounted to postgres (so /data will be inside the immich containers too)
Keyakinan
KeyakinanOP3y ago
Yeah that's kinda ugly, but that shouldn't be a problem right? I can chance that, I just chance UPLOAD_LOCATION to something else and hardcode the nfs location for database
jrasm91
jrasm913y ago
I'd maybe change upload location to be /mnt/pvc/Portainer/Immich/upload and then change the volume mount for postgres to be: - /mnt/pvc/Portainer/Immich/postgres:/var/lib/postgresql/data
Keyakinan
KeyakinanOP3y ago
Allright will do that. pvc = pve right?
jrasm91
jrasm913y ago
Probably lol. Whatever your path is/was
Keyakinan
KeyakinanOP3y ago
haha yeah oke thought so
jrasm91
jrasm913y ago
Can you try restarting the stack without the last three env variables? The IMMICH_WEB/SERVER/MICRO envs should not be needed (and the defaults should work just fine)
Keyakinan
KeyakinanOP3y ago
Changed it, still error:
No description
No description
No description
No description
Keyakinan
KeyakinanOP3y ago
The thing that puzzles me is that I can CRUD stuff from the containers in nfs share but when I change location to non nfs it seems to work
jrasm91
jrasm913y ago
Did you already check the logs in immich_server? Might be worth checking the permissions on the share from inside the container?
Keyakinan
KeyakinanOP3y ago
I will check the logs again, I didn't see anything but maybe didn't look at the right location. I will look into permissions, have to go right now. Thank you for all your help so far 🙏 seems like I either checked the wrong log or at the wrong time. postgresql : 2023-01-27 18:55:24.581 UTC [43] FATAL: no pg_hba.conf entry for host "172.21.0.6", user "postgres", database "immich", no encryption server: [Nest] 1 - 01/27/2023, 6:56:51 PM ERROR [ExceptionHandler] no pg_hba.conf entry for host "172.21.0.7", user "postgres", database "immich", no encryption error: no pg_hba.conf entry for host "172.21.0.7", user "postgres", database "immich", no encryption at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/dist/parser.js:287:98) at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/dist/parser.js:126:29) at Parser.parse (/usr/src/app/node_modules/pg-protocol/dist/parser.js:39:38) at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/dist/index.js:11:42) at Socket.emit (node:events:527:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Socket.Readable.push (node:internal/streams/readable:228:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
jrasm91
jrasm913y ago
Hey hey that's an error that makes more sense You are using the immich provided postgres container right?
Keyakinan
KeyakinanOP3y ago
yes this error is very usefull! I am indeed
jrasm91
jrasm913y ago
You know what, we've moved the postgres data location. Can you stop the stack, delete the postgres data directory and then start it up again?
Keyakinan
KeyakinanOP3y ago
This is atleast new
No description
jrasm91
jrasm913y ago
Did the imimch-server container come up fine?
Keyakinan
KeyakinanOP3y ago
Does it need to come up first?
jrasm91
jrasm913y ago
The dependencies are in the stack to if you just shut it down and start it up it should be fine. But did you check the log and see if the postgres error is still there or if it went away?
danielo515
danielo5153y ago
I'm having a similar error after upgrading the stack
PisK
PisK3y ago
The same problem here. immich_server said it fails to connect the database postgres container said the error below exec: "/usr/local/bin/docker-entrypoint.sh": stat /usr/local/bin/docker-entrypoint.sh: permission denied
Keyakinan
KeyakinanOP3y ago
So after being busy I've decided to just purge everything , change nfs permission on host. Mount directly to lxc container. I've just started from scratch and it worked straight away! I'm pretty sure it was the NFS permissions but I can't say for sure. Hopefully this is stable and I can just start back-up completely of all pictures!
Wicked
Wicked3y ago
I'm getting the same error after upgrading the stack. No change has been made to the env or the host machine.
Alex Tran
Alex Tran3y ago
Did you disable IPv6? we enable support for IPv6 and apparently it cause some issues for some people
Wicked
Wicked3y ago
I dont think i touched IPv6. Where in the docker config do i disable it?
No description
Alex Tran
Alex Tran3y ago
Are you on the latest version? 1.47.2?
Wicked
Wicked3y ago
Yes
No description
Alex Tran
Alex Tran3y ago
Can you post your .env? Please make sure to have DB_HOSTNAME=immich_postgres in it
Wicked
Wicked3y ago
DB_USERNAME=postgres DB_PASSWORD=*** DB_DATABASE_NAME=immich UPLOAD_LOCATION=/mnt/deluge/Partilhas/immich JWT_SECRET=** ENABLE_MAPBOX=false VITE_SERVER_ENDPOINT=http://192.168.1.30:2283/api DB_HOSTNAME=immich_postgres
Alex Tran
Alex Tran3y ago
does it work now after you include the DB_HOSTNAME and bring down/up the stack again?
Wicked
Wicked3y ago
Nope, same error with or without
jrasm91
jrasm913y ago
Then something is wrong in your compose file. Where is the ip of 127.0.0.1 coming from?
Parton
Parton3y ago
Hello. I had this issue. I did not think it through and I deleted the images. Is there any db backup I can restore? Because now it is completely clean.
Wicked
Wicked3y ago
I was working fine for 6 months. Update from 1.45 onwards broke it for some reason. 127.0.0.1 is localhost. ` version: "3.8" services: immich-server: image: altran1502/immich-server:release entrypoint: ["/bin/sh", "./start-server.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env environment: - NODE_ENV=production depends_on: - redis - database restart: always immich-microservices: image: altran1502/immich-server:release entrypoint: ["/bin/sh", "./start-microservices.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env environment: - NODE_ENV=production depends_on: - redis - database restart: always immich-machine-learning: image: altran1502/immich-machine-learning:release entrypoint: ["/bin/sh", "./entrypoint.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env environment: - NODE_ENV=production depends_on: - database restart: always immich-web: image: altran1502/immich-web:release entrypoint: ["/bin/sh", "./entrypoint.sh"] env_file: - .env restart: always redis: container_name: immich_redis image: redis:6.2 restart: always database: container_name: immich_postgres image: postgres:14 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} PG_DATA: /var/lib/postgresql/data volumes: - pgdata:/var/lib/postgresql/data restart: always immich-proxy: container_name: immich_proxy image: altran1502/immich-proxy:release ports: - 2283:8080 logging: driver: none depends_on: - immich-server restart: always volumes: pgdata:` Here's the docker-compose code env file was a few lines back I even redeployed with all the basic .env and docker-compose files from your wiki keeping only the pgdata and error persists
Alex Tran
Alex Tran3y ago
Can you update your docker-compose file to the latest one? And also your .env
Wicked
Wicked3y ago
Thats exactly what i did. Same result. cant upload the whole thing without discord nitro, ill break in two ersion: "3.8" services: immich-server: container_name: immich_server image: altran1502/immich-server:release entrypoint: ["/bin/sh", "./start-server.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env environment: - NODE_ENV=production depends_on: - redis - database restart: always immich-microservices: container_name: immich_microservices image: altran1502/immich-server:release entrypoint: ["/bin/sh", "./start-microservices.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env environment: - NODE_ENV=production depends_on: - redis - database restart: always immich-machine-learning: container_name: immich_machine_learning image: altran1502/immich-machine-learning:release entrypoint: ["/bin/sh", "./entrypoint.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env environment: - NODE_ENV=production depends_on: - database restart: always immich-web: container_name: immich_web image: altran1502/immich-web:release entrypoint: ["/bin/sh", "./entrypoint.sh"] env_file: - .env restart: always redis: container_name: immich_redis image: redis:6.2 restart: always database: container_name: immich_postgres image: postgres:14 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} PG_DATA: /var/lib/postgresql/data volumes: - pgdata:/var/lib/postgresql/data restart: always immich-proxy: container_name: immich_proxy image: altran1502/immich-proxy:release environment: # Make sure these values get passed through from the env file - IMMICH_SERVER_URL - IMMICH_WEB_URL ports: - 2283:8080 logging: driver: none depends_on: - immich-server restart: always volumes: pgdata: JWT_SECRET=*** DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_PASSWORD=*** DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis UPLOAD_LOCATION=/mnt/deluge/Partilhas/immich IMMICH_WEB_URL=http://immich-web:3000 IMMICH_SERVER_URL=http://immich-server:3001 IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003
Alex Tran
Alex Tran3y ago
Are you using portainer? Have you swapped out .env for stack.env?
jrasm91
jrasm913y ago
We require db hostname as an env variable now. You probably aren't setting that correctly.
Wicked
Wicked3y ago
what else do i need to change? db hostname is the docker container name everything is default, but since 1.45 it stopped working i can see i'm not alone with this issue and i really didn't want to delete my database
jrasm91
jrasm913y ago
How are you deploying it? Are you running docker compose up?
Dapuzz
Dapuzz3y ago
Hello guys, I am facing exactly same error message. Docker with portainer, old configuration worked well up to latest update where I have error message attached
No description
Dapuzz
Dapuzz3y ago
btw 172.24.0.6 is the immich_server and not the database not sure if this is or not the same issue as previous users
Alex Tran
Alex Tran3y ago
Can you post your setup?
Dapuzz
Dapuzz3y ago
Thanks Alex, it is pretty the default docker compose yaml, I try to paste here
Alex Tran
Alex Tran3y ago
A screenshot can be helpful as well for portainer setup and the environment variables that you used
Dapuzz
Dapuzz3y ago
here the env configuration
No description
Alex Tran
Alex Tran3y ago
Can you try bring the whole stack down, instead of restart the stack? then after that, bring them all up
Dapuzz
Dapuzz3y ago
let's try 🙂 Thanks @Alex Tran it did the trick!! sorry to have bothered you with so easy solution, stop and start again!
Alex Tran
Alex Tran3y ago
no problem I know that docker-compose if you don't bring up and down explicitly, the restart sometimes running into weird state
Dapuzz
Dapuzz3y ago
good to know, maybe we need to add some sequence in starting the containers?
Alex Tran
Alex Tran3y ago
We already have that sequence
Dapuzz
Dapuzz3y ago
oh, depends on already there
Alex Tran
Alex Tran3y ago
My guess here is the immich-proxy doesn't always restart properly but an up and down put it in good place
Wicked
Wicked3y ago
using portainer stack
SMAW
SMAW3y ago
Also facing the same issue here after upgrading to 1.48.1... Getting this error in de PostgresDB: 2023-02-22 09:30:17.397 UTC [104] ERROR: insert or update on table "smart_info" violates foreign key constraint "FK_5e3753aadd956110bf3ec0244ac" 2023-02-22 09:30:17.397 UTC [104] DETAIL: Key (assetId)=(44a1427b-64ae-431e-860f-4212754b4f94) is not present in table "assets". 2023-02-22 09:30:17.397 UTC [104] STATEMENT: ALTER TABLE "smart_info" ADD CONSTRAINT "FK_5e3753aadd956110bf3ec0244ac" FOREIGN KEY ("assetId") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE NO ACTION anyone know how to fix this one? @Alex Tran do you have any idea?
Alex Tran
Alex Tran3y ago
what is your setup look like?
SMAW
SMAW3y ago
Running from the Docker-compose file from the site everything default further
Alex Tran
Alex Tran3y ago
Can you access to the database container? let's run some query
SMAW
SMAW3y ago
Yes ....
Alex Tran
Alex Tran3y ago
docker exec -it immich_postgres bash
SMAW
SMAW3y ago
There I see the the errors
Alex Tran
Alex Tran3y ago
then psql -U postgres -d immich let me know when you are in
SMAW
SMAW3y ago
im in
Alex Tran
Alex Tran3y ago
Ok run this query select * from smart_info si where "assetId" = '44a1427b-64ae-431e-860f-4212754b4f94';
SMAW
SMAW3y ago
No description
Alex Tran
Alex Tran3y ago
now run select * from assets a where a.id = '44a1427b-64ae-431e-860f-4212754b4f94';
SMAW
SMAW3y ago
No description
SMAW
SMAW3y ago
0 rows Broken at an upload or so ?
Alex Tran
Alex Tran3y ago
ok now we just need to delete that row in the smart_info table perhaps we didin't have proper Foreign key before and this new update enforce it
SMAW
SMAW3y ago
Ah ok
Alex Tran
Alex Tran3y ago
DELETE
FROM smart_info
WHERE "assetId" = '44a1427b-64ae-431e-860f-4212754b4f94';
DELETE
FROM smart_info
WHERE "assetId" = '44a1427b-64ae-431e-860f-4212754b4f94';
and then restart your stack again to see if the migration would run succesfully
SMAW
SMAW3y ago
stopping 🙂 Yeah!
SMAW
SMAW3y ago
Immich working again
Alex Tran
Alex Tran3y ago
👏
SMAW
SMAW3y ago
Thanks Alex!
Alex Tran
Alex Tran3y ago
Thanks man, sorry for the hassle
SMAW
SMAW3y ago
No worries! bit offtopic I also saw something on a post, that Android should cache the timeline... When I start the app, it always says Building Timeline.... Is that OK?
Alex Tran
Alex Tran3y ago
if there is nothing new, it would reuse the cache value, if you upload new asset to the server, it would refetch the data. we are working toward an offline solution so that everything will be cache and Immich works offline Here is the PR to follow https://github.com/immich-app/immich/pull/1759
SMAW
SMAW3y ago
ah great! Thank you again for your project and help... Really love the project!
Alex Tran
Alex Tran3y ago
No problem man! Thank you for diving in 😄

Did you find this page helpful?