I
Immich2w ago
Zuri3l

Can't deploy a fully new instance 1.133.0 or restoring a backup

I've been having issues updating or restoring my instance backup, so I decided to deploy a new instance as a test, but when I tried,
-docker compose pull
-docker compose up -d
-docker compose pull
-docker compose up -d
-redis = ok -machine_learning = ok -database = wrong -immich_server = wrong
logs database
Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.


The database cluster will be initialized with locale "en_US.utf8".

The default database encoding has accordingly been set to "UTF8".

The default text search configuration will be set to "english".


Data page checksums are enabled.


initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

fixing permissions on existing directory /var/lib/postgresql/data ... 2025-05-22T17:31:50.928061974Z Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.
logs database
Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.


The database cluster will be initialized with locale "en_US.utf8".

The default database encoding has accordingly been set to "UTF8".

The default text search configuration will be set to "english".


Data page checksums are enabled.


initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

fixing permissions on existing directory /var/lib/postgresql/data ... 2025-05-22T17:31:50.928061974Z Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.
logs immich_server
Initializing Immich v1.133.0

Detected CPU Cores: 16

Starting api worker

Starting microservices worker

[Nest] 7 - 05/22/2025, 11:44:14 AM LOG [Microservices:EventRepository] Initialized websocket server

[Nest] 19 - 05/22/2025, 11:44:14 AM LOG [Api:EventRepository] Initialized websocket server

microservices worker error: Error: getaddrinfo ENOTFOUND database, stack: Error: getaddrinfo ENOTFOUND database

at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)

microservices worker exited with code 1

Killing api process

Initializing Immich v1.133.0

Detected CPU Cores: 16

Starting api worker

Starting microservices worker

[Nest] 7 - 05/22/2025, 11:45:18 AM LOG [Microservices:EventRepository] Initialized websocket server

[Nest] 19 - 05/22/2025, 11:45:18 AM LOG [Api:EventRepository] Initialized websocket server

microservices worker error: Error: getaddrinfo ENOTFOUND database, stack: Error: getaddrinfo ENOTFOUND database

at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)

microservices worker exited with code 1

Killing api process
logs immich_server
Initializing Immich v1.133.0

Detected CPU Cores: 16

Starting api worker

Starting microservices worker

[Nest] 7 - 05/22/2025, 11:44:14 AM LOG [Microservices:EventRepository] Initialized websocket server

[Nest] 19 - 05/22/2025, 11:44:14 AM LOG [Api:EventRepository] Initialized websocket server

microservices worker error: Error: getaddrinfo ENOTFOUND database, stack: Error: getaddrinfo ENOTFOUND database

at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)

microservices worker exited with code 1

Killing api process

Initializing Immich v1.133.0

Detected CPU Cores: 16

Starting api worker

Starting microservices worker

[Nest] 7 - 05/22/2025, 11:45:18 AM LOG [Microservices:EventRepository] Initialized websocket server

[Nest] 19 - 05/22/2025, 11:45:18 AM LOG [Api:EventRepository] Initialized websocket server

microservices worker error: Error: getaddrinfo ENOTFOUND database, stack: Error: getaddrinfo ENOTFOUND database

at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)

microservices worker exited with code 1

Killing api process
If I try to restore a backup, the situation is similar.
-fully new stack
-docker compose pull = ok
-docker compose create = ok
-docker start immich_postgres & sleep 10 = wrong
-fully new stack
-docker compose pull = ok
-docker compose create = ok
-docker start immich_postgres & sleep 10 = wrong
database logs

Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.


The database cluster will be initialized with locale "en_US.utf8".

The default database encoding has accordingly been set to "UTF8".

The default text search configuration will be set to "english".


Data page checksums are enabled.


initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

fixing permissions on existing directory /var/lib/postgresql/data ... 2025-05-22T17:56:27.987979427Z Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.
database logs

Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.


The database cluster will be initialized with locale "en_US.utf8".

The default database encoding has accordingly been set to "UTF8".

The default text search configuration will be set to "english".


Data page checksums are enabled.


initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

fixing permissions on existing directory /var/lib/postgresql/data ... 2025-05-22T17:56:27.987979427Z Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.
and the same thing over and over again, whenever I try to deploy it, even if it's a new instance like at the beginning HELPPPP...
13 Replies
Immich
Immich2w ago
:wave: Hey @Zuri3l, 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. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: 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.
Zuri3l
Zuri3lOP2w ago
Here are my compose.yml and .env files
Mraedis
Mraedis2w ago
You forgot to disable the command part of the database container
Zuri3l
Zuri3lOP2w ago
Okay, I've fixed that mistake
immich_server =
Initializing Immich v1.133.0

Detected CPU Cores: 16

Starting api worker

Starting microservices worker

[Nest] 7 - 05/22/2025, 12:26:48 PM LOG [Microservices:EventRepository] Initialized websocket server

[Nest] 19 - 05/22/2025, 12:26:49 PM LOG [Api:EventRepository] Initialized websocket server

microservices worker error: Error: getaddrinfo ENOTFOUND database, stack: Error: getaddrinfo ENOTFOUND database

at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)

microservices worker exited with code 1

Killing api process
immich_server =
Initializing Immich v1.133.0

Detected CPU Cores: 16

Starting api worker

Starting microservices worker

[Nest] 7 - 05/22/2025, 12:26:48 PM LOG [Microservices:EventRepository] Initialized websocket server

[Nest] 19 - 05/22/2025, 12:26:49 PM LOG [Api:EventRepository] Initialized websocket server

microservices worker error: Error: getaddrinfo ENOTFOUND database, stack: Error: getaddrinfo ENOTFOUND database

at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)

microservices worker exited with code 1

Killing api process
is now waiting for database i think but the database = ❌
Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.


The database cluster will be initialized with locale "en_US.utf8".

The default database encoding has accordingly been set to "UTF8".

The default text search configuration will be set to "english".


Data page checksums are enabled.


initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

fixing permissions on existing directory /var/lib/postgresql/data ... 2025-05-22T18:24:56.464255958Z Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.
Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.


The database cluster will be initialized with locale "en_US.utf8".

The default database encoding has accordingly been set to "UTF8".

The default text search configuration will be set to "english".


Data page checksums are enabled.


initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

fixing permissions on existing directory /var/lib/postgresql/data ... 2025-05-22T18:24:56.464255958Z Using SSD storage

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.
same problem I fixed the error in compose.yml. I'm deploying from scratch and the same problem.
Mraedis
Mraedis2w ago
Could you show us an ls -la from the folder where your docker compose.yml is at
Zuri3l
Zuri3lOP2w ago
yup, give me a second This is from the test stack
➜ immich ls -la
total 310248
drwxrwxrwx 1 root root 4096 May 22 13:11 .
drwxrwxrwx 1 root root 4096 May 22 12:34 ..
-rwxrwxrwx 1 root root 943 May 22 09:28 .env
-rwxrwxrwx 1 root root 2605 May 22 12:29 docker-compose.yml
-rwxrwxrwx 1 root root 317683872 May 21 18:40 dump.sql.gz
drwxrwxrwx 1 root root 4096 May 22 13:11 library
drwxrwxrwx 1 root root 4096 May 22 13:11 postgres
➜ immich ls -la
total 310248
drwxrwxrwx 1 root root 4096 May 22 13:11 .
drwxrwxrwx 1 root root 4096 May 22 12:34 ..
-rwxrwxrwx 1 root root 943 May 22 09:28 .env
-rwxrwxrwx 1 root root 2605 May 22 12:29 docker-compose.yml
-rwxrwxrwx 1 root root 317683872 May 21 18:40 dump.sql.gz
drwxrwxrwx 1 root root 4096 May 22 13:11 library
drwxrwxrwx 1 root root 4096 May 22 13:11 postgres
This is the command in my main stack, which is working correctly with version 1.132.3, where I have the same problem when updating or restoring the database.
➜ immich ls -la
total 32
drwxr-s---+ 3 root users 4096 may 22 07:57 .
drwxrws---+ 15 root users 4096 may 21 17:43 ..
-rw-r-----+ 1 root users 3446 may 22 07:56 docker-compose.yml
-rw-r-----+ 1 root users 1017 may 22 07:57 .env
drwx------+ 21 openmediavault-webgui root 4096 may 22 07:57 postgres
➜ immich ls -la
total 32
drwxr-s---+ 3 root users 4096 may 22 07:57 .
drwxrws---+ 15 root users 4096 may 21 17:43 ..
-rw-r-----+ 1 root users 3446 may 22 07:56 docker-compose.yml
-rw-r-----+ 1 root users 1017 may 22 07:57 .env
drwx------+ 21 openmediavault-webgui root 4096 may 22 07:57 postgres
Mraedis
Mraedis2w ago
Your postgres folder is owned by root How did you make this "test" stack?
Zuri3l
Zuri3lOP2w ago
On my Windows 10 machine, using WSL 2 with Ubuntu and using the terminal, I used mkdir for the main folder and from the terminal using Docker Compose I deployed the stack. but I have the same problem with my installation on my server with omv, in fact they are the same errors that it is giving me, but only version 1.133.0, all previous versions work correctly and I can deploy them normally, for immich I do not use the gui, only terminal
Zuri3l
Zuri3lOP2w ago
No description
Zuri3l
Zuri3lOP2w ago
I even downloaded the docker-compose.yml and example.env files from the repository to test and it didn't work either
➜ immich docker exec -it immich_postgres bash
Error response from daemon: Container 2eb290c3064b5e398b32771b82705fa2a0d4909de9958ad5fcf5b2c3852e6ffe is restarting, wait until the container is running
➜ immich docker exec -it immich_postgres bash
Error response from daemon: Container 2eb290c3064b5e398b32771b82705fa2a0d4909de9958ad5fcf5b2c3852e6ffe is restarting, wait until the container is running
I have tried to manually change the permissions of the container folder but it does not allow me to enter the container for obvious reasons.
NoMachine
NoMachine2w ago
try changing the owner of your postgres folder to user 999
Zuri3l
Zuri3lOP2w ago
I tried it but it didn't work, for some reason even if I use sudo the owner is still root
➜ immich-app la
total 303M
-rwxrwxrwx 1 root root 943 May 22 09:28 .env
-rwxrwxrwx 1 root root 2.6K May 22 12:29 docker-compose.yml
-rwxrwxrwx 1 root root 303M May 21 18:40 dump.sql.gz
drwxrwxrwx 1 root root 4.0K May 22 14:42 library
drwxrwxrwx 1 root root 4.0K May 22 14:42 postgres
➜ immich-app sudo chown 999:999 postgres
➜ immich-app la
total 303M
-rwxrwxrwx 1 root root 943 May 22 09:28 .env
-rwxrwxrwx 1 root root 2.6K May 22 12:29 docker-compose.yml
-rwxrwxrwx 1 root root 303M May 21 18:40 dump.sql.gz
drwxrwxrwx 1 root root 4.0K May 22 14:42 library
drwxrwxrwx 1 root root 4.0K May 22 14:42 postgres
➜ immich-app la
total 303M
-rwxrwxrwx 1 root root 943 May 22 09:28 .env
-rwxrwxrwx 1 root root 2.6K May 22 12:29 docker-compose.yml
-rwxrwxrwx 1 root root 303M May 21 18:40 dump.sql.gz
drwxrwxrwx 1 root root 4.0K May 22 14:42 library
drwxrwxrwx 1 root root 4.0K May 22 14:42 postgres
➜ immich-app sudo chown 999:999 postgres
➜ immich-app la
total 303M
-rwxrwxrwx 1 root root 943 May 22 09:28 .env
-rwxrwxrwx 1 root root 2.6K May 22 12:29 docker-compose.yml
-rwxrwxrwx 1 root root 303M May 21 18:40 dump.sql.gz
drwxrwxrwx 1 root root 4.0K May 22 14:42 library
drwxrwxrwx 1 root root 4.0K May 22 14:42 postgres
And yes, I also tried to deploy it after change it and it didn't work, same error
Mraedis
Mraedis2w ago
what 👀 Ok here's what I would do in case everything seems "stuck" like this Turn off the immich stack, reboot the whole machine, see if you can change owner now

Did you find this page helpful?