Bug 968843 - cannot delete a group after jobs have been submitted for it
Summary: cannot delete a group after jobs have been submitted for it
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: develop
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.13
Assignee: Amit Saha
QA Contact: Nick Coghlan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-30 05:39 UTC by Dan Callaghan
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-25 06:27:03 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 968865 0 medium CLOSED Group Remove link should be visible only to group owners and Beaker admins 2021-02-22 00:41:40 UTC

Internal Links: 968865

Description Dan Callaghan 2013-05-30 05:39:34 UTC
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.

Comment 1 Amit Saha 2013-06-03 02:22:23 UTC
On Gerrit: http://gerrit.beaker-project.org/#/c/2008/

Comment 3 Nick Coghlan 2013-06-06 07:58:59 UTC
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

Comment 5 Amit Saha 2013-06-25 06:27:03 UTC
Beaker 0.13.1 has been released.


Note You need to log in before you can comment on or make changes to this bug.