ls1intum / Artemis

Artemis - Interactive Learning with Automated Feedback
https://docs.artemis.cit.tum.de
MIT License
452 stars 275 forks source link

`Exam mode`: Edge case - cannot delete exam #8884

Open florian-glombik opened 4 days ago

florian-glombik commented 4 days ago

Describe the bug

An internal server error occurs when deleting an exam.

To Reproduce

I did not find a consistent way to reproduce this behavior, I had this problem with some exams in the course https://artemis.in.tum.de/course-management/275/exams

  1. Go to the exam management
  2. Try to delete an exam
  3. See that the exam deletion might now work

It seems that waiting some time can resolve the issue (yesterday I could not delete the exam NavbarIssueDemo, which was possible today, but I cannot delete NavbarIssueDemo2)

Expected behavior

Deleting an exam should not throw an error and be independent of previous exam deletions.

Screenshots

image

Which version of Artemis are you seeing the problem on?

7.3.0

What browsers are you seeing the problem on?

Chrome

Additional context

In this particular example the exam I wanted to delete was https://artemis.in.tum.de/api/courses/275/exams/673 (Delete)

Relevant log output

{
    "type": "https://www.jhipster.tech/problem/problem-with-message",
    "title": "Internal Server Error",
    "status": 500,
    "detail": "could not execute batch [Cannot delete or update a parent row: a foreign key constraint fails (`Artemis`.`build_log_statistics_entry`, CONSTRAINT `FKarrnc5l01jjyixrw6jbu18k6b` FOREIGN KEY (`programming_submission_id`) REFERENCES `submission` (`id`))] [delete from submission where id=?]; SQL [delete from submission where id=?]; constraint [null]",
    "path": "/api/courses/275/exams/673",
    "message": "error.http.500"
}