Skip to content

Users::MigrateRecordsToGhostUserInBatchesWorker exception due to workspace record with PAT

Summary

User deletions fail because of workspace records that reference a personal access token that is being deleted, raising an exception.

ERROR:  update or delete on table "personal_access_tokens" violates foreign key constraint "fk_ec70695b2c" on table "workspaces" (PG::ForeignKeyViolation)
DETAIL:  Key (id)=(TOKEN_ID) is still referenced from table "workspaces".

Related:

Steps to reproduce

What is the current bug behavior?

  • The user is never deleted because the worker runs into an exception

What is the expected correct behavior?

  • The user is deleted because any records are handled as expected

Relevant logs and/or screenshots

Edited by Jio Castillo