Bug 1166270 - OSE 2.0: oo-admin-yum-validator doesn't handle error code from failed subscription-manager repo-override calls
Summary: OSE 2.0: oo-admin-yum-validator doesn't handle error code from failed subscri...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: ---
Assignee: John W. Lamb
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1166276 1166277
TreeView+ depends on / blocked
 
Reported: 2014-11-20 17:06 UTC by John W. Lamb
Modified: 2015-01-15 12:45 UTC (History)
7 users (show)

Fixed In Version: openshift-enterprise-upgrade-2.0.11.7-1.el6op
Doc Type: Bug Fix
Doc Text:
Cause: The subscription-manager package version 1.10.7 and higher now incorporates the "content override" feature, which typically requires network communication with a backend server. Certain functions of yum-validator for RHSM systems depend on this network traffic on systems where subscription-manager supports content overrides. yum-validator didn't properly handle situations where subscription-manager calls failed due to network-related issues (timeouts, connection resets, etc.) Consequence: subscription-manager related functions which had previously been virtually guaranteed to work - since they only operated on the local filesystem in older subscription-manager versions - now could raise unhandled exceptions due to network failures. Fix: Routines which depend on subscription-manager are now wrapped in exception-handling blocks, and network errors cause oo-admin-yum-validator to fail with a unique non-zero return value. Result: Scripts which depend on oo-admin-yum-validator can now detect that oo-admin-yum-validator failed due to network errors, and handle the failure appropriately. Users running oo-admin-yum-validator are now presented with a relevant error message instead of a confusing stack trace.
Clone Of:
: 1166276 1166277 (view as bug list)
Environment:
Last Closed: 2015-01-15 12:45:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0053 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.0.8 bug fix update 2015-01-15 17:44:38 UTC

Description John W. Lamb 2014-11-20 17:06:18 UTC
Description of problem:

On systems with RHSM subscriptions and a subscription-manager version that supports repo-override, occasionally a repo-override operation can fail due to some upstream error (e.g. 502 or 500 HTTP errors are what I have seen in the past). oo-admin-yum-validator doesn't process the error code subscription-manager generates in these instances, but it should

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

openshift-enterprise-yum-validator-2.0.11.5-1.el6op

How reproducible:

Not very - it depends on a failure on systems that we don't have control over

Steps to Reproduce:
1. run oo-admin-yum-validator -e -f
2. if step 1 doesn't cause a failure, run subscription-manager repo-override --remove-all and re-run step 1
3.

Actual results:

The subscription-manager error is displayed in the same output stream as the yum-validator output

Expected results:

yum-validator would detect the failure and retry the operation a few times before failing

Additional info:

Because of the nature of the failures I've seen I think this is best implemented as retry with expanding timeout

Comment 3 wangyanyan 2014-12-18 07:55:43 UTC
Verify step:
env: ose2.0.z/2014-12-15.3
Setup:
1.Register rhsm in env
2.Install oo-admin-yum-validator and yum-plugin-priorities 

Actions:
1.subscription-manager repo-override --repo=rhel-6-server-ose-2.0-jbosseap-rpms --add=enabled:0
2.Modify "/usr/lib64/python2.6/site-packages/yumvalidator/check_sources.py" file let it error in get_update_override_cmd, then execute "oo-admin-yum-validator  -o 2.0 -r client -r node-eap -f"

output:
...
A problem occured while using subscription-manager services. This often indicates a problem communicating with the subscription-manager server component. Please resolve the issue and try again.

subscription-manager failed, with these arguments: /usr/sbin/subscription-manager repo-override --repo=rhel-6-server-ose-2.2-node-rpms --add=enabled:1

Can find it retried a few times before failing

Comment 4 wangyanyan 2014-12-18 08:42:25 UTC
(In reply to wangyanyan from comment #3)
> Verify step:
> env: ose2.0.z/2014-12-15.3
> Setup:
> 1.Register rhsm in env
> 2.Install oo-admin-yum-validator and yum-plugin-priorities 
> 
> Actions:
> 1.subscription-manager repo-override
> --repo=rhel-6-server-ose-2.0-jbosseap-rpms --add=enabled:0
> 2.Modify "/usr/lib64/python2.6/site-packages/yumvalidator/check_sources.py"
> file let it error in get_update_override_cmd, then execute
> "oo-admin-yum-validator  -o 2.0 -r client -r node-eap -f"
> 
> output:
> ...
> A problem occured while using subscription-manager services. This often
> indicates a problem communicating with the subscription-manager server
> component. Please resolve the issue and try again.
> 
> subscription-manager failed, with these arguments:
> /usr/sbin/subscription-manager repo-override
> --repo=rhel-6-server-ose-2.2-node-rpms --add=enabled:1
> 
> Can find it retried a few times before failing
Modify output
output:
...
A problem occured while using subscription-manager services. This often indicates a problem communicating with the subscription-manager server component. Please resolve the issue and try again.

subscription-manager failed, with these arguments: /usr/sbin/subscription-manager repo-override --repo=rhel-6-server-ose-2.0-jbosseap-rpms --add=enabled:1

Can find it retried a few times before failing

Comment 6 errata-xmlrpc 2015-01-15 12:45:08 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-0053.html


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