Bug 915549

Summary: Task table is missing a unique constraint on 'Name' field
Product: [Retired] Beaker Reporter: Amit Saha <asaha>
Component: schedulerAssignee: Amit Saha <asaha>
Status: CLOSED CURRENTRELEASE QA Contact: Dan Callaghan <dcallagh>
Severity: urgent Docs Contact:
Priority: high    
Version: 0.11CC: asaha, dcallagh, ebaak, llim, qwan, rglasz, rmancy
Target Milestone: 0.12   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: Misc
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-11 04:57:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 912205    

Description Amit Saha 2013-02-26 03:30:59 UTC
Description of problem:

The Task table should have a unique constraint on the 'Name' field which allows multiple tasks of the same name to exist, which is not desirable and task queries break.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:

'sqlalchemy.orm.exc.MultipleResultsFound'>:Multiple rows were found for one()"


Expected results:

The enforced constraint should automatically disallow duplicate more than one task with the same name.


Additional info:

Comment 1 Amit Saha 2013-02-26 03:33:29 UTC
(In reply to comment #0)
> Description of problem:
> 
> The Task table should have a unique constraint on the 'Name' field which
> allows multiple tasks of the same name to exist, which is not desirable and
> task queries break.
> 
> Version-Release number of selected component (if applicable):
> 
> 
> How reproducible:
> 
> 
> Steps to Reproduce:
> 1.
> 2.
> 3.
>   
> Actual results:
> 
> 'sqlalchemy.orm.exc.MultipleResultsFound'>:Multiple rows were found for
> one()"
> 
> 
> Expected results:
> 
> The enforced constraint should automatically disallow duplicate more than
> one task with the same name.

The enforced constraint should automatically disallow more than one task with the same name.


> 
> 
> Additional info:

Comment 2 Dan Callaghan 2013-02-26 22:38:22 UTC
Complete stack trace for reference:

 Traceback (most recent call last):
   File "/usr/lib/python2.6/site-packages/bkr/server/xmlrpccontroller.py", line 54, in RPC2
     response = self.process_rpc(method,params)
   File "/usr/lib/python2.6/site-packages/bkr/server/xmlrpccontroller.py", line 43, in process_rpc
     response = obj(*params)
   File "/usr/lib/python2.6/site-packages/bkr/server/tasks.py", line 518, in to_xml
     return Task.by_name(name, valid).to_xml(pretty)
   File "/usr/lib/python2.6/site-packages/bkr/server/model.py", line 6243, in by_name
     return query.one()
   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1687, in one
     "Multiple rows were found for one()")
 MultipleResultsFound: Multiple rows were found for one()

Comment 3 Amit Saha 2013-03-21 05:46:29 UTC
On  Gerrit: http://gerrit.beaker-project.org/#/c/1812/

Comment 7 Dan Callaghan 2013-04-11 04:57:31 UTC
Beaker 0.12 has been released.