[BUG] Delete user causes violation of FK constraint in 1.46 #679

Closed
opened 2026-02-04 21:53:00 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @zackpollard on GitHub (Feb 10, 2023).

Originally assigned to: @zackpollard on GitHub.

The bug

If a user existed with albums, that was then subsequently deleted, it seems we at some point, or even now still, don't clean up the relations correctly. This means that the new FK constraint in 1.46 on owner in album entity cannot be created, and the server boot loops.

The OS that Immich Server is running on

N/A

Version of Immich Server

1.46

Version of Immich Mobile App

1.46

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

1. Run server 1.45
2. Create user
3. Create album
4. Delete user
5. Upgrade to 1.46
6. Server won't run migrations due to FK constraint violation

Additional information

No response

Originally created by @zackpollard on GitHub (Feb 10, 2023). Originally assigned to: @zackpollard on GitHub. ### The bug If a user existed with albums, that was then subsequently deleted, it seems we at some point, or even now still, don't clean up the relations correctly. This means that the new FK constraint in 1.46 on owner in album entity cannot be created, and the server boot loops. ### The OS that Immich Server is running on N/A ### Version of Immich Server 1.46 ### Version of Immich Mobile App 1.46 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML N/A ``` ### Your .env content ```Shell N/A ``` ### Reproduction steps ```bash 1. Run server 1.45 2. Create user 3. Create album 4. Delete user 5. Upgrade to 1.46 6. Server won't run migrations due to FK constraint violation ``` ### Additional information _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#679