-
-
Notifications
You must be signed in to change notification settings - Fork 671
Open
Labels
Description
Current Behavior
When trying to delete a team that has been referenced in some notification rule (as recipient) there is Server Error 500 and the following server log:
2025-08-21 14:29:26,184 ERROR [Transaction] Operation commit failed on resource: org.datanucleus.store.rdbms.ConnectionFactoryImpl$EmulatedXAResource@213f4cb7, error code UNKNOWN and transaction [DataNucleus Transaction, ID=-1155218550-21406928, enlisted resources=[org.datanucleus.store.rdbms.ConnectionFactoryImpl$EmulatedXAResource@213f4cb7]] : ERROR: update or delete on table "TEAM" violates foreign key constraint "NOTIFICATIONRULE_TEAMS_FK2" on table "NOTIFICATIONRULE_TEAMS"
Detail: Key (ID)=(33) is still referenced from table "NOTIFICATIONRULE_TEAMS". [principal=admin, requestUri=/v1/team, requestId=*****************, requestMethod=DELETE]
2025-08-21 14:29:26,184 ERROR [GlobalExceptionHandler] Uncaught internal server error [principal=admin, requestUri=/v1/team, requestId=***************, requestMethod=DELETE]
...
Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "TEAM" violates foreign key constraint "NOTIFICATIONRULE_TEAMS_FK2" on table "NOTIFICATIONRULE_TEAMS"
Detail: Key (ID)=(33) is still referenced from table "NOTIFICATIONRULE_TEAMS".
...
Steps to Reproduce
- Create a team called "team1"
- Create a notification alert/rule and assign "team1" as recipient to it.
- Delete "team1"
Server Error 500 is the response on the UI.
Expected Behavior
While deleting team it is first deleted from all notification rules (as recipient references) and then the team is deleted.
Dependency-Track Version
4.13.2
Dependency-Track Distribution
Container Image
Database Server
PostgreSQL
Database Server Version
No response
Browser
Google Chrome
Checklist
- I have read and understand the contributing guidelines
- I have checked the existing issues for whether this defect was already reported