Bug 822620 - spacewalk-repo-sync errors if package already exists in another org
Summary: spacewalk-repo-sync errors if package already exists in another org
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.8
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: 822621 space18
TreeView+ depends on / blocked
 
Reported: 2012-05-17 15:52 UTC by Tasos Papaioannou
Modified: 2012-11-01 16:20 UTC (History)
0 users

Fixed In Version: spacewalk-backend-1.8.27-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 822621 (view as bug list)
Environment:
Last Closed: 2012-11-01 16:20:22 UTC
Embargoed:


Attachments (Terms of Use)
proposed patch for spacewalk-repo-sync query (893 bytes, patch)
2012-05-17 15:52 UTC, Tasos Papaioannou
no flags Details | Diff

Description Tasos Papaioannou 2012-05-17 15:52:09 UTC
Created attachment 585260 [details]
proposed patch for spacewalk-repo-sync query

Description of problem:

If the same package exists in another organization, then spacewalk-repo-sync will fail to import that package for the currently syncing channel, with an error like the following:

Could not find object [<server.importlib.importLib.IncompletePackage instance; attributes={'package_size': None, 'package_arch_id': 119, 'name': 'fibreutils', 'checksum_list': None, 'md5sum': None, 'org_id': '45', 'epoch': '', 'checksums': {'md5': '668aaed9c017895da3578b4c96634892'}, 'channels': {1945: 'tpapaioa-00589382-rhel6'}, 'nevra_id': 137349, 'package_id': None, 'last_modified': None, 'name_id': 9555, 'version': '3.2', 'checksum': '668aaed9c017895da3578b4c96634892', 'release': '4', 'checksum_type': 'md5', 'arch': 'x86_64', 'evr_id': 30886, 'checksum_id': 7538339}] in table rhnPackage
Sync complete

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

spacewalk-backend-server-1.7.38-1.fc16

How reproducible:

100%

Steps to Reproduce:
1.) Create channel in org #1, linked to an external yum repo.
2.) Run spacewalk-repo-sync for that channel.
3.) Create another channel in org #2, linked to the same repo.
4.) Run spacewalk-repo-sync for the new channel.
  
Actual results:

"Could not find object" errors like the one above. Packages not imported into the organization or linked to the channel.

Expected results:

No error, package created in org #2, and package linked to the channel successfully.

Additional info:

The get_info_for_package query in backend/server/rhnPackage.py does not filter on packages in the same org as the channel. I'm attaching a patch that works in my testing.

Comment 1 Michael Mráka 2012-05-18 12:42:12 UTC
Fixed in spacewalk master by
commit a901506ac8abb58804876fae3f65c1dac089daf9
    822620 - lookup packages only from correct org

Comment 2 Jan Pazdziora 2012-10-30 19:24:55 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 3 Jan Pazdziora 2012-11-01 16:20:22 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18


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