domjudge icon indicating copy to clipboard operation
domjudge copied to clipboard

Removing a problem from a contest fails if there are submissions

Open vmcj opened this issue 1 year ago • 6 comments

Description of the problem

We get the following error: An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`domjudge`.`judging_run`, CONSTRAINT `FK_29A6E6E13CBA64F2` FOREIGN KEY (`judgetaskid`) REFERENCES `judgetask` (`judgetaskid`))

Your environment

  • main branch
  • BAPC2023 dump

Steps to reproduce

  • Either load the BAPC2023 dump or upload a contest with example problems
  • Make sure everything is judged
  • Remove the contest problem from a contest

Expected behaviour

The contest problem gets deleted or we don't allow removing the problem from the contest, no server errors expected

Actual behaviour

Error, problem is not removed (so we stay consistent)

vmcj avatar Nov 06 '23 16:11 vmcj

I cannot repro this, and thought it is fixed via https://github.com/DOMjudge/domjudge/commit/181ae06a5625611274f7217be85cfd28d5f351b4

If you have a dump and know the exact source state BAPC ran in I would be interested into looking into this.

meisterT avatar Nov 23 '23 21:11 meisterT

I cannot repro this, and thought it is fixed via 181ae06

If you have a dump and know the exact source state BAPC ran in I would be interested into looking into this.

Strange, I think I also got this after BAPC (but on an empty DB) by loading the example problems and trying to delete the admin user.

vmcj avatar Nov 23 '23 21:11 vmcj

trying to delete the admin user

This issue is about removing a problem. https://github.com/DOMjudge/domjudge/issues/2207 is about deleting the user

meisterT avatar Nov 23 '23 21:11 meisterT

trying to delete the admin user

This issue is about removing a problem. #2207 is about deleting the user

You're right, but also this is about removing a problem from a contest (which I think is important)

I tried to remove the hello world from /problems, that works, if you remove (or unlink actually) the problem from the demo contest than we get an issue.

vmcj avatar Nov 23 '23 22:11 vmcj