Can't delete User


  • Used Zammad version: This is Zammad version 5.0.x
  • Used Zammad installation type: docker-compose (self-hosted)
  • Operating system:
  • Browser + version: Chrome Version 118.0.5993.88 (Official Build) (x86_64)

Expected behavior:

  • User gets deleted - all tickets set to base user

Actual behavior:

  • Deletion process fails with following error:
failed (ERROR: #<ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR: update or delete on table "users" violates foreign key constraint "fk_rails_ab5f91f9d0" on table "mentions" DETAIL: Key (id)=(1833) is still referenced from table "mentions". >)

Unfortunately, I can’t upgrade the Zammad Version at the moment - I know it is already a bit outdated. I could edit the entries (102) in the mentions table manually, would just need to know if I should delete all entries for this user there or if I update the created_by_id column to the base user.

My initial. problem was that the user is always set back to active once the ldap has synced. I tried everything from changing the group assignment (which determines the agent status) to change the role to customer etc.

Thanks for all the possible help here.

Upgrade your installation, this should be a bug that’s already fixed.

Thank you - but what could I do in the meantime. This leads to a wave of spam emails due to a non-existing email address and I need a quickfix before I can take on the upgrade.

Deleting users doesn’t solve issues with spam messages coming in.

I think I didn’t phrase this clear enough. My zammad instance tries to reach this user - a former agent - (among others) via email. But this email-address does not exist anymore, and I’m flooded with exchange emails due to this. I can’t remove the Agent-Status (it is reset each time ldap syncs), I can’t inactivate the user permanently (same reason). Therefore, I thought the deletion would help…

LDAP sync would synchronize it back in all the time.
Fix your LDAP filter if the user account is no longer available in the result during sync it will be deactivated.

Or take over the user session and disable mail notifications.


Thank you a lot - will try your suggestions.

Thank you again for your support - just wanted to let you know that the hint regarding the ldap filters helped in my case. It turned out the ldap db was not updated. Thank you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.