iris-web icon indicating copy to clipboard operation
iris-web copied to clipboard

[BUG] Cases with tasks including comments can't be deleted

Open StaSys846 opened this issue 1 year ago • 1 comments

Describe the bug Deletion of a case is not possible when comments (for any case item) are present in the case. On deletion via "case management" in WebGUI all case related objects are deleted, but the case itself remains. Log error says:

sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) update or delete on table "cases" violates foreign key constraint "comments_comment_case_id_fkey" on table "comments"
DETAIL:  Key (case_id)=(xxx) is still referenced from table "comments".

To Reproduce Steps to reproduce the behavior:

  1. Create a new case
  2. add an element to the case (e.g. asset / IOC)
  3. Add an comment to the new element
  4. Go to: Case Management
  5. Select the newly created case
  6. Open the case and click "Delete case"
  7. An Error message will appear image

Expected behavior With deletion of the case all case related objects should be deleted/removed inclusively the case itself.

Desktop (please complete the following information):

  • OS: Ubunutu
  • Browser: n/a
  • Version: v2.4.7

StaSys846 avatar Jun 05 '24 07:06 StaSys846

Just encountered the same issue while testing. @StaSys846 Thanks for the workaround

PurplePetrus avatar Aug 28 '24 12:08 PurplePetrus