Bug 576907

Summary: Package profiles incorectly compare multilib packages.
Product: Red Hat Satellite 5 Reporter: Miroslav Suchý <msuchy>
Component: ProvisioningAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Šimon Lukašík <slukasik>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, slukasik, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-04-23 07:10:55 UTC Type: ---
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: 518256, 541508    

Description Miroslav Suchý 2010-03-25 15:29:49 UTC
Description of problem:
Let have package profile with packages:
 curl-7.12.1-3.i386.rpm
 curl-7.12.1-3.x86_64.rpm
Then if you upgrade (on EL4) you will get:
 curl-7.12.1-11.1.el4_8.2.i386.rpm
 curl-7.12.1-11.1.el4_8.2.x86_64.rpm
And you compare those profiles you will get incorrect comparsion.
 
For Provisioning->Snapshots->Snapshot Tags->choose snapshot->Packages you will get:
 curl  	 7.12.1-11.1.el4_8.2  	 7.12.1-3  	 Current profile newer 
Notice that there is no information about architectures.

That is because in web/modules/rhn/RHN/DB/Package.pm in function delta_canonical_lists_hashref is key only package name, where should be and architecture.
But if you do rollback, it complete and rollback both i386 and x86_64 package version. But you could not choose to rollback only one.


For Software->Packages->Profiles->selected profile you will get:
curl 7.12.1-11.1.el4_8.2.i386  	  	 This system only
curl 7.12.1-11.1.el4_8.2.x86_64 	7.12.1-3.x86_64 	Profile only
curl 7.12.1-3.i386 	Profile only 
So the i386 version did not match each other and rollback will fail.

Comment 1 Miroslav Suchý 2010-03-26 09:45:36 UTC
for the second case, when I run rhn_check -vv on client I get:
...
D: do_call packages.runTransaction ({'packages': [[['curl', '7.12.1', '11.1.el4_8.2', '', 'i386'], 'e'], [['curl', '7.12.1', '3', '', 'x86_64'], 'i'], [['curl', '7.12.1', '3', '', 'i386'], 'i']]},)
...
D: Sending back response (40, "Failed: The transaction failed for the following reasons:\n[('file /usr/bin/curl from install of curl-7.12.1-3 conflicts with file from package curl-7.12.1-11.1.el4_8.2', (7, '/usr/bin/curl', 0L)), ('file /usr/lib64/libcurl.so.3.0.0 from install of curl-7.12.1-3 conflicts with file from package curl-7.12.1-11.1.el4_8.2', (7, '/usr/lib64/libcurl.so.3.0.0', 0L))]", {'failed_elements': [('file /usr/bin/curl from install of curl-7.12.1-3 conflicts with file from package curl-7.12.1-11.1.el4_8.2', (7, '/usr/bin/curl', 0L)), ('file /usr/lib64/libcurl.so.3.0.0 from install of curl-7.12.1-3 conflicts with file from package curl-7.12.1-11.1.el4_8.2', (7, '/usr/lib64/libcurl.so.3.0.0', 0L))], 'version': '0', 'name': 'packages.runTransaction.failed_transaction'})
...

Comment 2 Miroslav Suchý 2010-03-26 15:48:43 UTC
Snapshot Tags (i.e. the first case) has been fixed by commit to spacewalk git 843d26c5bac826f977002da9aed4fb3f73f8ba4d

It add new column "Architecture" to list of package differences
and treat package with different architecture as different package.

Comment 3 Tomas Lestach 2010-04-02 08:32:19 UTC
Multi lib comparison fixed in the java code part.

the commit also fixes the system/profile sync
spacewalk.git: f4d30229c16b1ad5af1e1606ec1efce4fbcb800e

Comment 4 Tomas Lestach 2010-04-02 12:00:04 UTC
Fix available in:
* spacewalk-web-0.5.23-34
* spacewalk-java-0.5.44-74

Comment 5 Tomas Lestach 2010-04-08 17:55:45 UTC
I did similar changes for system sync as done for profile sync in previous commit.

spacewalk.git: 8f3c3a3979302763e15be67e764ddd04a6181f4a
satellite.git: 0a960ef2674bad0a08d22030197c3eac3d24e461

Fix available in: spacewalk-java-0.5.44-75

Comment 6 Šimon Lukašík 2010-04-12 09:47:18 UTC
Changing to verified:

Testing procedure:
1) fresh install of rhel4-GOLD x86_64
2) install curl-7.12.1-3.i386.rpm 
3) create package profile
4) create system tag
5) up2date -u (and repeat 3,4)
6) various comparisons between system and stored profile 
7) various comparisons between system and stored tag
8) check rhn_check -vv, and installed packages

Results:
Ok. Comparisons shows new 'Architecture' column. profile/tag differences are handled separately for each architecture. Against new profile/tag packages synced correctly.

Please note:
System profiles created before this advisory does not contain information about architecture. Some architecture columns in comparison may be blank. So appropriates packages could not match.

Client configuration used:
rhel-x86_64-as-4 with few i386 packages

Verified against: (on rhel-i386-server-5)
spacewalk-java-0.5.44-75
spacewalk-web-0.5.23-34

Comment 15 errata-xmlrpc 2010-04-23 07:10:55 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0369.html