Database error after upgrade
Glad that immich survived 2 upgrades in the past without issue, but today after upgrading my instance I got database container restarting loop reading this in log:
5 Replies
:wave: Hey @دورايمون,
Thanks for reaching out to us. Please follow the recommended actions below; 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 compose ps
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
Checklist
1. :ballot_box_with_check: I have verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: I have read applicable release notes.
3. :ballot_box_with_check: I have reviewed the FAQs for known issues.
4. :ballot_box_with_check: I have reviewed Github for known issues.
5. :ballot_box_with_check: I have tried accessing Immich via local ip (without a custom reverse proxy).
6. :blue_square: I have uploaded the relevant logs, docker compose, and .env files, making sure to use code formatting.
7. :ballot_box_with_check: I have 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)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.This is the compose for database:
I use cosmos, so don't mind the labels
Any help is highly appreciated 🤞
I tried re-pulling the images, restarting the server, recreating the stack
Sadly I can't even exec a bash to db docker as its restarting...
"command": "postgres -c shared_preload_libraries=vectors.so -c search_path=\"$user\", public, vectors",
It's complaining about this being wrong
The command line we use is command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
Okay, I will try it now, probably the compose from cosmos repo is not updated
Thanks for help @bo0tzz
I don't fully understand the diference between cosmos-compose and stock docker-compose, but I guess it should be the same.. however it doesn't seem to pass the argumants correctly
Ok so I asked chatgpt, and it solved it
To address this issue, the goal is to ensure that PostgreSQL interprets the search_path parameter correctly without it being misinterpreted by the shell or Docker.
Revised Command:
json
Copy code
Explanation:
Double Escaping: Use \" to properly escape the double quotes (") around $user so that Docker passes them correctly to PostgreSQL.
Escaping the $: Use \$user to ensure that $user is recognized as a variable by PostgreSQL after Docker processes the command.
No Spaces: Removed spaces around the commas in search_path to prevent issues with parsing.
This format should correctly pass the search_path value to PostgreSQL without errors.
Wow that’s ugly. Glad it worked though