I
Immich•3w ago
dipper998

Immich Server won't start - microservices worker error

Logs attached
45 Replies
Immich
Immich•3w ago
:wave: Hey @dipper998, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
Immich
Immich•3w ago
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
dipper998
dipper998OP•3w ago
I'm not sure how this happened, it was just kinda out of nowhere - immich_server randomly kept restarting a few days ago and yesterday it just wouldn't start at all.
Mraedis
Mraedis•3w ago
It can't reach your postgres container Start by compose down + up, if that does nothing, check your postgres logs in DB_DATA_LOCATION/log
NoMachine
NoMachine•3w ago
I wonder... where did you get this compose file?
Mraedis
Mraedis•3w ago
Looks pretty tame apart from switching out to PG16 and a pgadmin container?
NoMachine
NoMachine•3w ago
yeah, but I believe first time should try the documented procedure then start making changes. imho
dipper998
dipper998OP•3w ago
Apologies for the late reply - been at work This isn't my first launch, I've had Immich up and running fine for over a year now I'll just grab the postgres logs I've also restarted the stack multiple times to no avail
dipper998
dipper998OP•3w ago
here's the last two logs from /log
Mraedis
Mraedis•3w ago
What are you hosting on @dipper998?
dipper998
dipper998OP•3w ago
Custom little PC based on a HP Prodesk Mini i7 9500t, 16GB RAM, 500GB SSD
Mraedis
Mraedis•3w ago
No I mean what OS 😛
dipper998
dipper998OP•3w ago
to be clear: I'm not using anything like unraid or truenas, just docker on Ubuntu realised that just now 😅
Mraedis
Mraedis•3w ago
can you docker exec -it immich_postgres psql -U postgres ?
dipper998
dipper998OP•3w ago
I tried that, then with the db username in my .env
No description
Mraedis
Mraedis•3w ago
You need the -d immich for immichuser
dipper998
dipper998OP•3w ago
root@hp-server:~# docker exec -it immich_postgres psql -d immichuser
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "root" does not exist
root@hp-server:~# docker exec -it immich_postgres psql -d immichuser
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "root" does not exist
Mraedis
Mraedis•3w ago
I said -d immich :p also -U immichuser docker exec -it immich_postgres psql -U immichuser -d immich -U for user and -d for database
dipper998
dipper998OP•3w ago
ah apologies i see what you mean now yep I'm in now
psql (16.8 (Debian 16.8-1.pgdg120+1))
Type "help" for help.

immich=#
psql (16.8 (Debian 16.8-1.pgdg120+1))
Type "help" for help.

immich=#
I can type after the hashtag
Mraedis
Mraedis•3w ago
alright so the database is there and the container stays up just exit now :p next potential culprit: apparmor suddenly turning hostile Not sure where the logs for apparmor are because I don't use it, but check out /var/log/apparmor probably
dipper998
dipper998OP•3w ago
is that in the db container?
Mraedis
Mraedis•3w ago
No on your host
dipper998
dipper998OP•3w ago
I don't have an apparmor folder in /var/log on the host
Mraedis
Mraedis•3w ago
sudo aa-status to check whether you have it at all :p
dipper998
dipper998OP•3w ago
apparmor module is loaded.
165 profiles are loaded.
75 profiles are in enforce mode.
(a bunch of packages, etc. follow)
apparmor module is loaded.
165 profiles are loaded.
75 profiles are in enforce mode.
(a bunch of packages, etc. follow)
Mraedis
Mraedis•3w ago
Ah it's in /var/log/audit/audit.log try grep -ni /var/log/audit/audit.log -e DENIED | tail for instance
dipper998
dipper998OP•3w ago
I don't have a /var/log/audit folder grep: /var/log/audit/audit.log: No such file or directory
Mraedis
Mraedis•3w ago
uh, sudo it? ah wait you're root nvm
dipper998
dipper998OP•3w ago
I already sudo -s at the beginning
Mraedis
Mraedis•3w ago
You can try (temporarily) disabling it to rule it out as the culprit: systemctl stop apparmor Then compose down+up
dipper998
dipper998OP•3w ago
still errors unfortunately
Initializing Immich v1.132.3

Detected CPU Cores: 6

Starting api worker

Starting microservices worker

[Nest] 7 - 05/21/2025, 1:18:15 PM LOG [Microservices:EventRepository] Initialized websocket server

[Nest] 17 - 05/21/2025, 1:18:15 PM LOG [Api:EventRepository] Initialized websocket server

/usr/src/app/node_modules/postgres/cjs/src/connection.js:388

if (!query || typeof query !== 'object' || !query.reject) throw err

^

Error: connect EHOSTUNREACH 172.23.0.2:5432

at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16) {

errno: -113,

code: 'EHOSTUNREACH',

syscall: 'connect',

address: '172.23.0.2',


Initializing Immich v1.132.3

Detected CPU Cores: 6

Starting api worker

Starting microservices worker

[Nest] 7 - 05/21/2025, 1:18:15 PM LOG [Microservices:EventRepository] Initialized websocket server

[Nest] 17 - 05/21/2025, 1:18:15 PM LOG [Api:EventRepository] Initialized websocket server

/usr/src/app/node_modules/postgres/cjs/src/connection.js:388

if (!query || typeof query !== 'object' || !query.reject) throw err

^

Error: connect EHOSTUNREACH 172.23.0.2:5432

at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16) {

errno: -113,

code: 'EHOSTUNREACH',

syscall: 'connect',

address: '172.23.0.2',


Mraedis
Mraedis•3w ago
curious curious... Not running any other containers are you?
dipper998
dipper998OP•3w ago
I do have a bunch of other containers besides immich yes I haven't created any new ones in the past few days though
Mraedis
Mraedis•3w ago
docker ps --format 'table{{.Names}}\t{{.Ports}}' just to make sure
dipper998
dipper998OP•3w ago
Mraedis
Mraedis•3w ago
Could you try shutting down the listmonk one to make sure it's not interfering? (and compose updown left right etc )
dipper998
dipper998OP•3w ago
yeah sure oh my word that was it
Mraedis
Mraedis•3w ago
Alright so we're halfway there now Are you using a big compose or separate ones? I"m assuming separate but just making sure
dipper998
dipper998OP•3w ago
halfway? I can access my instance now and there's no more error in the server logs anymore
Mraedis
Mraedis•3w ago
Yeah but I imagine you'd like the use the listmonk thing
dipper998
dipper998OP•3w ago
I can leave it for now don't worry it's not a big deal thank you for your help
Mraedis
Mraedis•3w ago
Immich has an env for specifying a database port, you could change it on our side or on the listmonk side if they support that
dipper998
dipper998OP•3w ago
yeah I will do now that I know what the issue is

Did you find this page helpful?