Cannot delete migrated objects after update

Your question

I’m trying to clean up my setup since catch-all addresses are implemented differently in v0.16 than I’ve configured before. But whenever I try to delete something (a Domain, a Group) I get the error This item is referenced by other items and cannot be deleted.

However I don’t see any references to those items. Is there any possibility to see which item is referencing some item?

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

The key insight is in the delete command docs: when a deletion fails with objectIsLinked, the error message itself tells you which objects are blocking it – but this information is surfaced through stalwart-cli, not the WebUI.

Here is the situation and how to resolve it:

The WebUI currently shows the objectIsLinked error without naming the blocking objects. To see exactly what is referencing the item you want to delete, use stalwart-cli:

stalwart-cli delete domain --ids <your-domain-id>

If the domain is blocked, the output will look like:

<id> failed: objectIsLinked
  Linked by:   Account#abc, MailingList#def

That Linked by: line names each object that holds a reference. You then delete or update those objects first (e.g. accounts or groups with a domainId pointing to this domain, mailing lists, DKIM signatures, etc.) and retry.

Common culprits after a migration to the current release:

  • Account (User or Group) objects with a domainId pointing to the domain you want to remove.
  • MailingList objects with a domainId reference.
  • DkimSignature objects tied to the domain.

You can inspect them with:

stalwart-cli query account --fields id,name,domainId --json | jq 'select(.domainId=="<your-domain-id>")'

Once you remove or re-point all the referencing objects, the domain/group deletion will succeed.

Relevant docs: Removing objects (stalwart-cli) and Searching and listing (stalwart-cli).

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong. If you found it useful, mention @helpbot in any reply to ask follow-up questions and the bot will respond again.

The bot reply is correct, and the UI needs to be enhanced to return which items are linked.