Description of problem: Beaker returns a 500 if you try to delete a group after jobs have been submitted for it. Version-Release number of selected component (if applicable): beaker-server-0.12.1-1.git.133.6c74a92.el6.noarch Steps to Reproduce: 1. Create a group 2. Submit a job for the group 3. Try to remove the group (Admin -> Groups, click Remove) Actual results: Beaker returns a 500. 2013-05-30 05:32:41,180 cherrypy.msg INFO HTTP: Page handler: <bound method Groups.remove of <bkr.server.group.Groups object at 0x7fed4eedba90>> Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 121, in _run self.main() File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 264, in main body = page_handler(*virtual_path, **self.params) File "<string>", line 3, in remove File "/usr/lib/python2.6/site-packages/turbogears/identity/conditions.py", line 249, in require return fn(self, *args, **kwargs) File "<string>", line 3, in remove File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 361, in expose *args, **kw) File "<generated code>", line 0, in run_with_transaction File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in __call__ return self.body(*args, **kw) File "/usr/lib/python2.6/site-packages/turbogears/database.py", line 463, in sa_rwt session.commit() [...] IntegrityError: (IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`beaker_devel`.`job`, CONSTRAINT `job_group_id_fk` FOREIGN KEY (`group_id`) REFERENCES `tg_group` (`group_id`))') 'DELETE FROM tg_group WHERE tg_group.group_id = %s' (14L,) Expected results: Not sure... at least a friendly error message. The Remove link shouldn't appear either, if the removal is going to be disallowed. It's probably not practical to allow the deletion in this case, since it would affect completed job rows which is never supposed to happen. We have declared in the past that systems cannot be deleted for the same reason.
On Gerrit: http://gerrit.beaker-project.org/#/c/2008/
Confirmed this works as expected on the integration instance: 1. Ran a job on behalf of a group 2. Attempted to remove that group 3. Received a notification the group could not be deleted due to associated jobs
Beaker 0.13.1 has been released.