[10.11.5] Cannot add some videos to favorites #7516

Open
opened 2025-12-22 05:59:37 +01:00 by backuprepo · 4 comments
Owner

Originally created by @LibertX on GitHub (Oct 23, 2025).

Description of the bug

Hello,

On a fresh install of Jellyfin 10.11.0 and library imported (using NFO content, no library metadata agent or plugins), some videos are impossible to favorite.

The button stays "blank", and the following stack trace appears in the logs:

Oct 23 07:53:14 jellyfin[2979445]: System.InvalidOperationException: 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.
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode`1 node)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode`1 node, Func`2 handleNode)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState targetState, EntityState storeGeneratedWithKeySetTargetState, Boolean forceStateWhenUnknownKey)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.Add(TEntity entity)
Oct 23 07:53:14 jellyfin[2979445]:    at Emby.Server.Implementations.Library.UserDataManager.SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Controllers.UserLibraryController.MarkFavorite(User user, BaseItem item, Boolean isFavorite)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Controllers.UserLibraryController.MarkFavoriteItem(Nullable`1 userId, Guid itemId)
Oct 23 07:53:14 jellyfin[2979445]:    at lambda_method141495(Closure, Object, Object[])
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location ---
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location ---
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location ---
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

It seems to only happens on some files.

Reproduction steps

  1. Fresh install with no particular options enabled
  2. Create a library that have video files and NFO associated to these files
  3. Favorite videos.

What is the current bug behavior?

Item cannot be added to favorites.

What is the expected correct behavior?

Item should be added to favorites.

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.11.0

Environment

- OS: Rocky Linux 10
- Linux Kernel: 6.14.11-3-pve
- Virtualization: Podman running in a LXC container
- Clients: Web
- Browser: Chrome
- FFmpeg Version: 
- Playback Method: Direct Play
- Hardware Acceleration: Intel QuickSync
- GPU Model: Intel ARC A380
- Plugins: None
- Reverse Proxy: Caddy
- Base URL:
- Networking: Podman
- Jellyfin Data Storage: LXC mount bind to host
- Media Storage:
- External Integrations:

Jellyfin logs

Oct 23 07:53:14 jellyfin[2979445]: [09:53:14] [ERR] [32] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL POST /Users/c4795138adc346219c8a320d2817edaa/FavoriteItems/0534900bae61f2f8b00ef715c2857d47.
Oct 23 07:53:14 jellyfin[2979445]: System.InvalidOperationException: 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.
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode`1 node)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode`1 node, Func`2 handleNode)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState targetState, EntityState storeGeneratedWithKeySetTargetState, Boolean forceStateWhenUnknownKey)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.Add(TEntity entity)
Oct 23 07:53:14 jellyfin[2979445]:    at Emby.Server.Implementations.Library.UserDataManager.SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Controllers.UserLibraryController.MarkFavorite(User user, BaseItem item, Boolean isFavorite)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Controllers.UserLibraryController.MarkFavoriteItem(Nullable`1 userId, Guid itemId)
Oct 23 07:53:14 jellyfin[2979445]:    at lambda_method141495(Closure, Object, Object[])
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location ---
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location ---
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location ---
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
Oct 23 07:53:14 jellyfin[2979445]:    at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
Oct 23 07:53:14 jellyfin[2979445]:    at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

No response

Originally created by @LibertX on GitHub (Oct 23, 2025). ### Description of the bug Hello, On a fresh install of Jellyfin 10.11.0 and library imported (using NFO content, no library metadata agent or plugins), some videos are impossible to favorite. The button stays "blank", and the following stack trace appears in the logs: ``` Oct 23 07:53:14 jellyfin[2979445]: System.InvalidOperationException: 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. Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode`1 node) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode`1 node, Func`2 handleNode) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState targetState, EntityState storeGeneratedWithKeySetTargetState, Boolean forceStateWhenUnknownKey) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.Add(TEntity entity) Oct 23 07:53:14 jellyfin[2979445]: at Emby.Server.Implementations.Library.UserDataManager.SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Controllers.UserLibraryController.MarkFavorite(User user, BaseItem item, Boolean isFavorite) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Controllers.UserLibraryController.MarkFavoriteItem(Nullable`1 userId, Guid itemId) Oct 23 07:53:14 jellyfin[2979445]: at lambda_method141495(Closure, Object, Object[]) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location --- Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location --- Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location --- Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context) ``` It seems to only happens on some files. ### Reproduction steps 1. Fresh install with no particular options enabled 2. Create a library that have video files and NFO associated to these files 3. Favorite videos. ### What is the current _bug_ behavior? Item cannot be added to favorites. ### What is the expected _correct_ behavior? Item should be added to favorites. ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version 10.11.0 ### Environment ```markdown - OS: Rocky Linux 10 - Linux Kernel: 6.14.11-3-pve - Virtualization: Podman running in a LXC container - Clients: Web - Browser: Chrome - FFmpeg Version: - Playback Method: Direct Play - Hardware Acceleration: Intel QuickSync - GPU Model: Intel ARC A380 - Plugins: None - Reverse Proxy: Caddy - Base URL: - Networking: Podman - Jellyfin Data Storage: LXC mount bind to host - Media Storage: - External Integrations: ``` ### Jellyfin logs ```shell Oct 23 07:53:14 jellyfin[2979445]: [09:53:14] [ERR] [32] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL POST /Users/c4795138adc346219c8a320d2817edaa/FavoriteItems/0534900bae61f2f8b00ef715c2857d47. Oct 23 07:53:14 jellyfin[2979445]: System.InvalidOperationException: 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. Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode`1 node) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode`1 node, Func`2 handleNode) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState targetState, EntityState storeGeneratedWithKeySetTargetState, Boolean forceStateWhenUnknownKey) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.Add(TEntity entity) Oct 23 07:53:14 jellyfin[2979445]: at Emby.Server.Implementations.Library.UserDataManager.SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Controllers.UserLibraryController.MarkFavorite(User user, BaseItem item, Boolean isFavorite) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Controllers.UserLibraryController.MarkFavoriteItem(Nullable`1 userId, Guid itemId) Oct 23 07:53:14 jellyfin[2979445]: at lambda_method141495(Closure, Object, Object[]) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location --- Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location --- Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Oct 23 07:53:14 jellyfin[2979445]: --- End of stack trace from previous location --- Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) Oct 23 07:53:14 jellyfin[2979445]: at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) Oct 23 07:53:14 jellyfin[2979445]: at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context) ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information _No response_
backuprepo added the
bug
label 2025-12-22 05:59:37 +01:00
Author
Owner

@LibertX commented on GitHub (Oct 28, 2025):

Issue is still occurring on 10.11.2.

@LibertX commented on GitHub (Oct 28, 2025): Issue is still occurring on 10.11.2.
Author
Owner

@Porthorion commented on GitHub (Nov 10, 2025):

I am facing the same issue with API calls to favorite / unfavorite music on the server. Just bumping this.

@Porthorion commented on GitHub (Nov 10, 2025): I am facing the same issue with API calls to favorite / unfavorite music on the server. Just bumping this.
Author
Owner

@LibertX commented on GitHub (Nov 18, 2025):

Still occuring on 10.11.3 and 10.11.4...

@LibertX commented on GitHub (Nov 18, 2025): Still occuring on 10.11.3 and 10.11.4...
Author
Owner

@LibertX commented on GitHub (Dec 15, 2025):

Still occurring in 10.11.5.

@LibertX commented on GitHub (Dec 15, 2025): Still occurring in 10.11.5.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#7516
No description provided.