Bug 658210

Summary: Yum RHN Plugin Exits '0' on Communication Failure
Product: Red Hat Enterprise Linux 5 Reporter: Marcelo Moreira de Mello <mmello>
Component: rhnlibAssignee: Miroslav Suchý <msuchy>
Status: CLOSED DEFERRED QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.5CC: cperry, james.antill, jhutar, mmello, msuchy, nbronson
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: 2011-03-14 16:40:22 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:

Description Marcelo Moreira de Mello 2010-11-29 17:08:52 UTC
Description of problem:

The Yum RHN plugin exits '0' when unable to connect to RHN. This leaves us unable to determine an error condition for regular updates if a customer is unable to connect to RHN. 

Version-Release number of selected component (if applicable):
     # rpm -q rhnlib yum
          rhnlib-2.5.22-3.el5_5.1
          yum-3.2.22-26.el5_5.1

     # Red Hat Enterprise Linux 5.5


How reproducible:
100%

Steps to Reproduce:
    # rpm -q yum
        yum-3.2.22-26.el5_5.1
    # rpm -q rhnlib
        rhnlib-2.5.22-3.el5_5.1

    # iptables -A OUTPUT -d xmlrpc.rhn.redhat.com -j REJECT

    # iptables -L -n
        Chain INPUT (policy ACCEPT)
          target     prot opt source               destination
 
        Chain FORWARD (policy ACCEPT)   
          target     prot opt source               destination
 
        Chain OUTPUT (policy ACCEPT) 
          target     prot opt source               destination
    REJECT     all  --  anywhere
xmlvip.rhn.prod.ext.phx2.redhat.com reject-with icmp-port-unreachable


     # yum update
          Loaded plugins: rhnplugin, security
          There was an error communicating with RHN.
          RHN support will be disabled.
          Error communicating with server. The message was:
          Connection refused
          Setting up Update Process
          No Packages marked for Update

      # echo $?
        0 
  
Actual results:
YUM + RHNPLUGIN exits with error code '0'


Expected results:
YUM + RHNPLUGIN exits with error code != '0'

Comment 2 Miroslav Suchý 2011-03-14 16:40:22 UTC
Current design of yum could not allow us to properly set exit code. I filed RFE for yum (bug 684859) and if it will be resolved (and back ported to RHEL5) you can reopen this BZ. But till then, there is nothing I can do.

Comment 3 James Antill 2011-03-14 18:57:47 UTC
 I think for this case you should just either raise PluginYumExit() or even raise Errors.RepoError.

Comment 4 Miroslav Suchý 2011-03-15 09:09:58 UTC
I do not think I want to raise Exit Exception and for sure not in prep phase. This is not fatal event. If you have some local repo, you can proceed without problem and upgrade your system. I just want to give user ability that this plugin had some serious problem. And writing to stdout seems to be out of question.