probo icon indicating copy to clipboard operation
probo copied to clipboard

Removing a user who has signed documents fails with unhelpful "internal server error"

Open emimoir opened this issue 7 months ago • 1 comments

Trying to remove a user from an organization fails with a generic "internal server error" if that user has signed any documents (or is referenced by other records like assets, tasks, etc) - message is unhelpful and does not tell the user why the error occurs.

Image

Steps to reproduce

  1. Log in as an Owner
  2. Go to People → add a new person (e.g. Employee role)
  3. Have that person sign a document (or assign them as owner of a task/risk/asset)
  4. Go back to People → try to remove that person via the "..." menu
  5. Error: "Failed to remove person: An internal server error occurred."

emimoir avatar Apr 27 '26 10:04 emimoir

Thanks @emimoir for the report.

We've shipped two improvements in probod v0.222.0:

  1. Task assignee / risk owner — You can now remove a person who is assigned to a task or owns a risk. Those references are cleared automatically on deletion (ON DELETE SET NULL).

  2. Asset owner (and other blocking references) — When removal is blocked because the person is still linked to a record that must be preserved (e.g. as an asset owner), the API now returns a 409 Conflict with "cannot remove person: referenced by other resources" instead of a generic internal server error. See the v0.222.0 changelog.

This builds on an earlier fix in probod v0.191.0 that started mapping foreign-key violations during profile deletion to a CONFLICT response (changelog).

The same explicit conflict response also applies when the person has signed documents — removal is still blocked in that case, but you should no longer see a generic internal server error.

Still outstanding: automatically removing a person who owns an asset (today you need to reassign the asset first). We'll track that separately.

Closing this issue for the error-handling and task/risk cases. Happy to reopen if you still hit an internal server error on probod ≥ v0.222.0.

lukkor avatar Jul 02 '26 17:07 lukkor