Folder migration failing with identity server Middleware exception for AD users

Error thrown when trying to migrate folder from classic to Modern:

UiPath.IdentityServer.Web.Middleware.ExceptionHandlingMiddleware User S-1-5-21-4100654559-430281245-1756809831-574978@global does not exist

When trying to migrate folders from classic to Modern, where the folder have AD users who are inactive in their directory Orchestrator fails migration with below errors:

Error in Event Viewer:

UiPath.IdentityServer.Web.Middleware.ExceptionHandlingMiddleware User S-1-5-21-4100654559-430281245-1756809831-574978@global does not exist

Resolution: As the above error suggests that security id of the AD user is being failed to migrate since it does not exist anymore in global domain.

  1. Identify the user from dbo.users table using SID and remove the user from the Folder (not from Orchestrator)
  2. After performing the above and removing all inactive users from folders, should solve above error.