Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 822620

Summary: spacewalk-repo-sync errors if package already exists in another org
Product: [Community] Spacewalk Reporter: Tasos Papaioannou <tpapaioa>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.8Keywords: Patch
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: spacewalk-backend-1.8.27-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 822621 (view as bug list) Environment:
Last Closed: 2012-11-01 16:20:22 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: 822621, 871344    
Attachments:
Description Flags
proposed patch for spacewalk-repo-sync query none

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 (Red Hat) 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 (Red Hat) 2012-11-01 16:20:22 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18