Cannot delete users in 10.6.0 #1829

Closed
opened 2026-02-06 21:24:15 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @Spiritreader on GitHub (Jun 25, 2020).

Describe the bug

Cannot delete users on latest nightly build because apparently they are duplicates. This also happens when a username was unique and has never been created before.

System (please complete the following information):

  • OS: Unraid 6.8.3
  • Virtualization: Docker
  • Clients: Any
  • Browser: Any
  • Jellyfin Version: nightly-20200624

To Reproduce

  1. Start jellyfin server with fresh config
  2. configure everything, set up media libraries
  3. log in with admin account, go to dashboard and create user
  4. try to delete user

Expected behavior

The user gets deleted

Logs

[2020-06-25 00:08:07.210 +02:00] [ERR] [25] Emby.Server.Implementations.HttpServer.HttpListenerHost: Error processing request. URL: "http://$SERVER/Users/fc9db3fb2a4345d88d1e71ed98d633a3"
System.InvalidOperationException: The instance of entity type 'User' cannot be tracked because another instance with the same key value for {'Id'} 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.
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode`1 node)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode`1 node, Func`2 handleNode)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState targetState, EntityState storeGeneratedWithKeySetTargetState, Boolean forceStateWhenUnknownKey)
   at Microsoft.EntityFrameworkCore.DbContext.SetEntityState(InternalEntityEntry entry, EntityState entityState)
   at Microsoft.EntityFrameworkCore.DbContext.Remove[TEntity](TEntity entity)
   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.Remove(TEntity entity)
   at Jellyfin.Server.Implementations.Users.UserManager.DeleteUser(User user)
   at MediaBrowser.Api.UserService.DeleteAsync(DeleteUser request)
   at Emby.Server.Implementations.Services.ServiceExecGeneral.Execute(Type serviceType, IRequest request, Object instance, Object requestDto, String requestName)
   at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost httpHost, Object requestDto, IRequest req)
   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IRequest httpReq, HttpResponse httpRes, ILogger logger, CancellationToken cancellationToken)
   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken)
Originally created by @Spiritreader on GitHub (Jun 25, 2020). **Describe the bug** <!-- A clear and concise description of what the bug is. --> Cannot delete users on latest nightly build because apparently they are duplicates. This also happens when a username was unique and has never been created before. **System (please complete the following information):** - OS: Unraid 6.8.3 - Virtualization: Docker - Clients: Any - Browser: Any - Jellyfin Version: nightly-20200624 **To Reproduce** <!-- Steps to reproduce the behavior: --> 1. Start jellyfin server with fresh config 2. configure everything, set up media libraries 3. log in with admin account, go to dashboard and create user 4. try to delete user **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> The user gets deleted **Logs** <!-- Please paste any log errors. --> ``` [2020-06-25 00:08:07.210 +02:00] [ERR] [25] Emby.Server.Implementations.HttpServer.HttpListenerHost: Error processing request. URL: "http://$SERVER/Users/fc9db3fb2a4345d88d1e71ed98d633a3" System.InvalidOperationException: The instance of entity type 'User' cannot be tracked because another instance with the same key value for {'Id'} 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. at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode`1 node) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode`1 node, Func`2 handleNode) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(InternalEntityEntry rootEntry, EntityState targetState, EntityState storeGeneratedWithKeySetTargetState, Boolean forceStateWhenUnknownKey) at Microsoft.EntityFrameworkCore.DbContext.SetEntityState(InternalEntityEntry entry, EntityState entityState) at Microsoft.EntityFrameworkCore.DbContext.Remove[TEntity](TEntity entity) at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.Remove(TEntity entity) at Jellyfin.Server.Implementations.Users.UserManager.DeleteUser(User user) at MediaBrowser.Api.UserService.DeleteAsync(DeleteUser request) at Emby.Server.Implementations.Services.ServiceExecGeneral.Execute(Type serviceType, IRequest request, Object instance, Object requestDto, String requestName) at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost httpHost, Object requestDto, IRequest req) at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IRequest httpReq, HttpResponse httpRes, ILogger logger, CancellationToken cancellationToken) at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IHttpRequest httpReq, String urlString, String host, String localPath, CancellationToken cancellationToken) ```
OVERLORD added the bug label 2026-02-06 21:24:15 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#1829