Closed mmomjian closed 7 months ago
Both the immich-server
and immich-microservices
run database migrations when they start up. If you start them up at exactly the same time they sometimes run into this issue.
Yes, they are starting at the same time. Thanks for the insight. In my experience this happens nearly 100% of the time. Does this pose any threat to the health of the Immich instance that is created with both migrations taking place at the same time? I imported about 50k images into my instance and it is running fine but I will start over if needed.
No, because they each run the migrations sequentially and inside of transactions so it's never an issue, except that one aborts if the other is doing the same thing at the same time.
That makes sense. Thank you. Would you be interested in me adding a "tips" section to the docker compose docs page outlining that this is a harmless message?
Yeah, you can add a tip and/or a FAQ for this error, until we find a more reliable way to run the migrations without the concurrency issue.
The bug
On a fresh run of Immich, I am getting a "duplicate key value violates unique constraint" error from Postgres at the very beginning of the logs for the
immich
container. Is anyone else able to replicate this same error? The issue does not persist after restarting an already initialized container - it is only present on the first run of a brand new instance, with a brand new UPLOAD_LOCATION and fresh (already existing database. Immich does not have superuser permission on the Postgres instance. Immich otherwise runs totally fine. Output below.The OS that Immich Server is running on
Debian 12
Version of Immich Server
v1.93.3
Version of Immich Mobile App
n/a
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Additional information