mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[10.11.1] Migrating userdata fails #7618
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BartvandenHout on GitHub (Oct 28, 2025).
Description of the bug
Migration from 10.10.7 to 10.11.1 fails with userdata from library.db.old
Can't find users with certain indexes:
Tried to find user with index '4' but there are only '12' users.
Tried to find user with index '5' but there are only '12' users.
Tried to find user with index '10' but there are only '12' users.
Error: "The instance of entity type 'UserData' cannot be tracked because another instance with the same key value for {'ItemId', 'UserId', 'CustomDataKey'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values."
Reproduction steps
Upgrade with apt from current 10.10.7 to 10.11.1
What is the current bug behavior?
Migration fails
What is the expected correct behavior?
Migration finishes
Jellyfin Server version
10.10.0+
Specify commit id
No response
Specify unstable release number
No response
Specify version number
10.10.7
Specify the build version
10.10.7
Environment
Jellyfin logs
FFmpeg logs
Client / Browser logs
No response
Relevant screenshots or videos
No response
Additional information
No response
@BartvandenHout commented on GitHub (Oct 31, 2025):
I checked my database Users-table. My guess is that because I have had users deleted and therefor 'user index' jumps from 3 to 7 and from 9 to 11.
Could this be the cause of errors?
@JoeGandy commented on GitHub (Oct 31, 2025):
I'm having the same issue
@BartvandenHout commented on GitHub (Nov 1, 2025):
Extra information: seems to me the "Tried to find user with index 'x' but there are only 'x' users."-errors are logged when building the userIdBlacklist (in MigrateLibraryDb.cs > GetUserData), which should be happening and is correctly done for id's 4, 5 and 10. But for some reason it's not added id 6 to userIdBlacklist, which is also NOT in my Users anymore.
PS. I don't know if this info is helpful or just more and unnecessary extra read. Sorry if its the latter.
@stignarnia commented on GitHub (Nov 10, 2025):
I have the same issue, plus also an issue with
Error: "The instance of entity type 'MediaStreamInfo'"@Jerrys-modz commented on GitHub (Nov 17, 2025):
Hi any update to this? I am having the same issue
@BartvandenHout commented on GitHub (Jan 5, 2026):
This fixed it for me, too:
https://github.com/jellyfin/jellyfin/issues/15147#issuecomment-3568095591