Users are marked as both active and deleted

How can I fix users in a limbo state of being active and deleted?

Issue Description

Sometimes, a user would end up in a state of being active and deleted and as a result, cannot be modified via the Orchestrator UI. Errors will occur such as "Unable to Assign", "Error Not Found(#1002)" or "User not found".

Resolution

To fix this issue, run the below SQL queries.
Note: Take a backup before doing any database changes.

  1. Find the users which are in that state.
Select UserName from dbo.users where IsDeleted=1 and IsActive=1;
Select UserName from identity.AspNetUsers where  IsDeleted=1 and IsActive=1;
  1. Correct the state of the users by marking them as deleted (IsDeleted=1 and IsActive=0) or Active (IsDeleted=0 and IsActive=1)
Update dbo.users set isActive=0 and isDeleted=1 where UserName in  ('userA', 'userB')
Update identity.AspNetUsers set isActive=0 and isDeleted=1 where UserName in ('userA', 'userB')


After these steps are done, modifying the users through the Orchestrator UI should be possible.