v1.33.0 Upgrade - Postgres unable to copy configuration file: Operation not permitted

I am attempting to upgrade the Postgres database dedicated to Immich. I am deploying in a Kubernetes environment. When reverting back to the previous Postgres image, everything is working fine. I only changed the image. Here's the full log from the moment the container is started:
Using SSD storage
cp: cannot create regular file '/etc/postgresql/postgresql.conf': Permission denied
chmod: changing permissions of '/var/run/postgresql': Operation not permitted

PostgreSQL Database directory appears to contain a database; Skipping initialization

postgres: could not access the server configuration file "/etc/postgresql/postgresql.conf": No such file or directory
Using SSD storage
cp: cannot create regular file '/etc/postgresql/postgresql.conf': Permission denied
chmod: changing permissions of '/var/run/postgresql': Operation not permitted

PostgreSQL Database directory appears to contain a database; Skipping initialization

postgres: could not access the server configuration file "/etc/postgresql/postgresql.conf": No such file or directory
The storage backend is Longhorn, though I do not believe this should be the issue, since the configuration is inside the Docker image.
10 Replies
Immich
Immich3w ago
:wave: Hey @The Bird, 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.
The Bird
The BirdOP3w ago
Here's the full statefulset.yaml file:
Zeus
Zeus3w ago
It currently doesn’t support non root deployments
The Bird
The BirdOP3w ago
Good to know! As a quick troubleshooting, I removed all of the security configuration. I am now getting the same error as describe in this thread: https://discord.com/channels/979116623879368755/1374884184086020227 My Postgres log:
Using SSD storage

PostgreSQL Database directory appears to contain a database; Skipping initialization

2025-05-21 23:23:37.643 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.conf"
2025-05-21 23:23:37.643 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf"
2025-05-21 23:23:37.643 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.conf"
2025-05-21 23:23:37.643 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf"
2025-05-21 23:23:41.124 GMT [1] LOG: starting PostgreSQL 14.17 (Debian 14.17-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2025-05-21 23:23:41.129 GMT [1] LOG: listening on IPv6 address "::1", port 5432
2025-05-21 23:23:41.129 GMT [1] LOG: listening on IPv4 address "127.0.0.1", port 5432
2025-05-21 23:23:41.159 GMT [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-05-21 23:23:41.230 GMT [29] LOG: database system was shut down at 2025-05-21 23:00:57 GMT
[2025-05-21T23:23:41Z INFO service::utils::clean] Find directory "pg_vectors/indexes/93315".
[2025-05-21T23:23:41Z INFO service::utils::clean] Find directory "pg_vectors/indexes/45380".
[2025-05-21T23:23:41Z INFO service::utils::clean] Find directory "pg_vectors/indexes/93315/segments/7837e6a0-204d-4f5c-89af-765af1c912ac".
2025-05-21 23:23:41.364 GMT [1] LOG: database system is ready to accept connections
[2025-05-21T23:23:44Z INFO service::utils::clean] Find directory "pg_vectors/indexes/45380/segments/af308568-fe21-4a64-9848-ca92eb2a6874".
Using SSD storage

PostgreSQL Database directory appears to contain a database; Skipping initialization

2025-05-21 23:23:37.643 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.conf"
2025-05-21 23:23:37.643 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf"
2025-05-21 23:23:37.643 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.conf"
2025-05-21 23:23:37.643 GMT [1] LOG: skipping missing configuration file "/var/lib/postgresql/data/postgresql.override.conf"
2025-05-21 23:23:41.124 GMT [1] LOG: starting PostgreSQL 14.17 (Debian 14.17-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2025-05-21 23:23:41.129 GMT [1] LOG: listening on IPv6 address "::1", port 5432
2025-05-21 23:23:41.129 GMT [1] LOG: listening on IPv4 address "127.0.0.1", port 5432
2025-05-21 23:23:41.159 GMT [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-05-21 23:23:41.230 GMT [29] LOG: database system was shut down at 2025-05-21 23:00:57 GMT
[2025-05-21T23:23:41Z INFO service::utils::clean] Find directory "pg_vectors/indexes/93315".
[2025-05-21T23:23:41Z INFO service::utils::clean] Find directory "pg_vectors/indexes/45380".
[2025-05-21T23:23:41Z INFO service::utils::clean] Find directory "pg_vectors/indexes/93315/segments/7837e6a0-204d-4f5c-89af-765af1c912ac".
2025-05-21 23:23:41.364 GMT [1] LOG: database system is ready to accept connections
[2025-05-21T23:23:44Z INFO service::utils::clean] Find directory "pg_vectors/indexes/45380/segments/af308568-fe21-4a64-9848-ca92eb2a6874".
And server log:
Initializing Immich v1.133.0
Detected CPU Cores: 4
Starting api worker
[Nest] 16 - 05/21/2025, 11:27:50 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 ECONNREFUSED 10.43.196.15:5432
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '10.43.196.15',
port: 5432
}

Node.js v22.14.0
api worker exited with code 1
Initializing Immich v1.133.0
Detected CPU Cores: 4
Starting api worker
[Nest] 16 - 05/21/2025, 11:27:50 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 ECONNREFUSED 10.43.196.15:5432
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '10.43.196.15',
port: 5432
}

Node.js v22.14.0
api worker exited with code 1
sandex
sandex3w ago
had the same issue, i was running db as user 1000 earlier, removed the runasuser: and it worked. see if you have the db running as some non-root user. although unsure if that is intended by the devs?
Flux
Flux3w ago
So essentially remove the user and group here?
database:
container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0-pgvectors0.2.0
#image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
user: ${IMMICH_PUID}:${IMMICH_PGID}
database:
container_name: immich_postgres
image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0-pgvectors0.2.0
#image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
user: ${IMMICH_PUID}:${IMMICH_PGID}
(Just double checking here) Confirmed you need to run it as root, which is disappointing, and shouldn't really be the standard with docker deployments like this It would be very appreciated if the DB can be ran as a non root user in the future
The Bird
The BirdOP3w ago
This fixes the Postgres database, however it does not change anything with the error on the "server" container
Flux
Flux2w ago
@Alex this is probs an issue (not being able to run DB as non-root)
Zeus
Zeus2w ago
Pretty sure we patched this, also please do not tag uninvolved people like that
Flux
Flux2w ago
Will test and report back. Ok that’s fair enough Working now, thank you.

Did you find this page helpful?