Bug 1155129

Summary: Provisioning failed when rhn_check runs with installed package spacewalk-koan
Product: Red Hat Enterprise Linux 6 Reporter: Pavel Studeník <pstudeni>
Component: yum-rhn-pluginAssignee: Matej Kollar <mkollar>
Status: CLOSED ERRATA QA Contact: Pavel Studeník <pstudeni>
Severity: high Docs Contact:
Priority: high    
Version: 6.6CC: cperry, dyordano, jherrman, jhutar, salmy, tlavigne
Target Milestone: rcKeywords: EasyFix, Regression, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: yum-rhn-plugin-0.9.1-52 Doc Type: Bug Fix
Doc Text:
Previously, provisioning virtual guests on Red Hat Enterprise 6 did not properly co-operate with the Satellite implementation of the koan tool. As a consequence, using the rhn_check program failed if the spacewalk-koan package was installed on the client. With this update, spacewalk-koan is compatible with rhn_check and the described problem no longer occurs.
Story Points: ---
Clone Of:
: 1156319 (view as bug list) Environment:
Last Closed: 2015-07-22 07:25:12 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: 1156319    

Description Pavel Studeník 2014-10-21 12:20:48 UTC
Description of problem:
I try to provision kvm system on RHEL6.6. And I get fatal error when I run provisioning for second time. (at first rhn_check installs this package to system)

It isn't possible to provisioning system by rhn_check when spacewalk-koan is installed.

I get same problem when I try update package, which is current.

Version-Release number of selected component (if applicable):
yum-rhn-plugin-0.9.1-50.el6.noarch

How reproducible:
always on RHEL6.6

Steps to Reproduce:
1. create kickstart 
2. install package spacewalk-koan on client 
3. run rhn_check -vvv

Actual results:
I can't provisioning system.
>> rhn_check -vvv
D: Using legacy gpg-pubkey(s) from rpmdb
D:  read h#     717 Header sanity check: OK
D: Package spacewalk-koan-0:2.0.1-2.el6sat.noarch already installed
D: Sending back response((6,), 'Fatal error in Python code occured', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}

Expected results:
provisioning works

Additional info:
fix https://github.com/spacewalkproject/spacewalk/commit/311592f3fd5f55bcb5e04a36dc3e4b3a040df329

Comment 8 Michael Mráka 2014-10-24 06:46:00 UTC
Fix from spacewalk master backported to CLIENT-RHEL-6 as
commit aac9b121a54ec549cc95956c96c594238b30bf94
    err variable needs to be initialized before assignment

Comment 11 Pavel Studeník 2015-03-12 13:58:14 UTC
Verified with yum-rhn-plugin-0.9.1-54.el6

Reproducer:

0) package yum-rhn-plugin-0.9.1-50.el6.noarch
1) register system to satellite
2) install package spacewalk-koan
3) create virtual guest by satellite webui
4) run rhn_check -vv


# tail /var/log/up2date
[Wed Mar 11 08:57:32 2015] up2date 
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 342, in __run_action
    (status, message, data) = CheckCli.__do_call(method, params, kwargs)
  File "/usr/sbin/rhn_check", line 335, in __do_call
    retval = method(*params, **kwargs)
  File "/usr/share/rhn/actions/packages.py", line 369, in update
    if err:
<type 'exceptions.UnboundLocalError'>: local variable 'err' referenced before assignment

[Wed Mar 11 08:57:32 2015] up2date D: Sending back response((6,), 'Fatal error in Python code occured', {})

Comment 12 Pavel Studeník 2015-05-06 12:34:17 UTC
Regression with newer package than yum-rhn-plugin-0.9.1-52.el6_6.noarch. Provisioning does not work and I get error "Error while executing packages action:
empty transaction"


# rhn_check -vv
D: check_action{'action': "<?xml
version='1.0'?>\n<methodCall>\n<methodName>packages.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><array><data>\n<value><string>spacewalk-koan</string></value>\n<value><string>2.3.0}

updateLoginInfo() login info
D: login(forceUpdate=True) invoked
logging into up2date server
D: rpcServer: Calling XMLRPC up2date.login
D: writeCachedLogin() invoked
D: Wrote pickled loginInfo at 1430742096.0 with expiration of
1430745696.0 seconds.
successfully retrieved authentication token from up2date server
D: logininfo:{'X-RHN-Server-Id': 1000011042, 'X-RHN-Auth-Server-Time':
'1430741966.73', 'X-RHN-Auth':
'fhd3Meu4dmOXcWN5aWoZ3EdoLBa0F5xGKr9DCe6RsAM=', 'X-RHN-Auth-Channels':
[['rhel-x86_64-server-6', '20150503011355', '1', '1'], ['rhn-too}
D: handle_action{'action': "<?xml
version='1.0'?>\n<methodCall>\n<methodName>packages.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><array><data>\n<value><string>spacewalk-koan</string></value>\n<value><string>2.3.}

D: handle_action actionid = 9434, version = 2
D: do_call packages.update([['spacewalk-koan', '2.3.0', '2.el6sat', '',
'noarch']],){'cache_only': None}
Loaded plugins: product-id, rhnplugin
D: rpcServer: Calling XMLRPC up2date.listChannels
This system is receiving updates from RHN Classic or RHN Satellite.
D: Called update[['spacewalk-koan', '2.3.0', '2.el6sat', '', 'noarch']]
Package spacewalk-koan-2.3.0-2.el6sat.noarch already installed and
latest version
0 0
D: Sending back response((6,), 'Error while executing packages action:
empty transaction', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}
D: local action status: (0, 'rpm database not modified since last update
(or package list recently updated)', {})
D: rpcServer: Calling XMLRPC registration.welcome_message


Satellite tried to update spacewalk-koan, but update is not available.
And action end with errot "empty transaction"

----
D: check_action{'action': "<?xml
version='1.0'?>\n<methodCall>\n<methodName>packages.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><array><data>\n<value><string>spacewalk-koan</string></value>\n<value><string>2.3.0}

updateLoginInfo() login info

----
D: Sending back response((6,), 'Error while executing packages action:
empty transaction', {})
----

# yum check-update
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.


# rpm -qf /usr/share/rhn/actions/packages.py
yum-rhn-plugin-0.9.1-57.el6.noarch

# yum info spacewalk-koan
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Installed Packages
Name        : spacewalk-koan
Arch        : noarch
Version     : 2.3.0
Release     : 2.el6sat
Size        : 60 k
Repo        : installed
 From repo   : rhn-tools-rhel-x86_64-server-6
Summary     : Support package for spacewalk koan interaction
URL         : https://fedorahosted.org/spacewalk
License     : GPLv2
Description : Support package for spacewalk koan interaction.


code:
             yum_base.doLock(YUM_PID_FILE)
             # Accumulate transaction data
             oldcount = len(yum_base.tsInfo)
-->>
        if not len(yum_base.tsInfo) > oldcount:

# note: result is "not 0 > 0":

             raise yum.Errors.YumBaseError, 'empty transaction'
-->>
             # depSolving stage
             (result, resultmsgs) = yum_base.buildTransaction()

Comment 13 Stephen Herr 2015-05-08 16:55:36 UTC
This FAILS_QA in comment 12 should be reported against bug 1183989 instead. Same symptom as this original bug, but different cause. Moving, please mark this bug as VALIDATED again.

Comment 14 Pavel Studeník 2015-05-19 13:47:02 UTC
Verified with yum-rhn-plugin-0.9.1-58.el6.noarch

Comment 15 errata-xmlrpc 2015-07-22 07:25:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1390.html