Bug 883887

Summary: Duplicate definition of package causes server Fault
Product: [Retired] Beaker Reporter: Marian Ganisin <mganisin>
Component: schedulerAssignee: matt jia <mjia>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: low    
Version: 0.10CC: aigao, asaha, dcallagh, mjia, qwan, rmancy, tools-bugs, xjia
Target Milestone: 0.16.1Keywords: EasyFix
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: Misc
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-26 23:54:30 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:

Description Marian Ganisin 2012-12-05 14:00:38 UTC
Description of problem:

If I try submit job with duplicate packages defined, server returns Fault. Duplicate was added by accident, however server should not crack up.

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

How reproducible:
Submit this:
<job>
    <whiteboard></whiteboard>
    <recipeSet>
        <recipe>
            <distroRequires>
                <and>
                    <distro_arch op="=" value="x86_64"/>
                    <distro_name op="=" value="RHEL-6.3"/>
                    <distro_variant op="=" value="Server"/>
                </and>
            </distroRequires>
            <hostRequires/>
            <packages>
                <package name="system-config-kdump"/>
                <package name="system-config-kdump"/>
            </packages>
            <task name="/distribution/install" role="STANDALONE"/>
        </recipe>
    </recipeSet>
</job>



Actual results:
Exception: <Fault 1: '<class \'sqlalchemy.exc.IntegrityError\'>:(IntegrityError) (1062, "Duplicate entry \'730496-103\' for key 1") \'INSERT INTO task_packages_custom_map (recipe_id, package_id) VALUES (%s, %s)\' ((730496L, 103L), (730496L, 103L))'>


Expected results:
Successful submit

Comment 1 Dan Callaghan 2012-12-05 22:04:03 UTC
Yet another case where we need to treat packages as a set instead of a list.

Comment 3 matt jia 2014-03-21 05:49:58 UTC
Patch is on gerrit:

http://gerrit.beaker-project.org/#/c/2944/

Cheers, Matt Jia

Comment 6 Dan Callaghan 2014-03-26 23:54:30 UTC
Beaker 0.16.1 has been released.