Zammad cant delete account

The reason for this is that you’re probably trying to remove agent accounts.
The reference error message in this state means that account with ID 6 created or updated at least one user account. As there’s active references, you naturally can’t remove that database entry.

I’m ignoring your elasticsearch error messages on propose: That indicates a wrong configuration between ES and Zammad.

A friendly

User.where(created_by_id: 6).update_all(created_by_id: 1)
User.where(updated_by_id: 6).update_all(updated_by_id: 1)

should do the trick.
Please note that removal of agents technically is possible, but not covered by our documentation. Usually you don’t want that anyway, because as you see above you’d need to remove tickets (because of references) or adjust data.

The following topics may affect you in that context as well: