Bug 704630 - Ugly traceback if the server is down
Summary: Ugly traceback if the server is down
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 2.1
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: ---
Assignee: mkovacik
QA Contact: mkovacik
URL:
Whiteboard:
Depends On:
Blocks: rhui-20
TreeView+ depends on / blocked
 
Reported: 2011-05-13 19:32 UTC by Jay Dobies
Modified: 2012-08-24 13:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The pulp command line's authentication process has changed and now requires credentials for all system calls. As a consequence, a ping check before a login attempt does not work due to the lack of credentials. This fix allows ping attempts without authentication. The pulp command line now successfully pings before a login attempt.
Clone Of:
Environment:
Last Closed: 2012-08-24 11:53:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Verifying screen log (3.78 KB, text/plain)
2012-08-09 15:50 UTC, mkovacik
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:1205 0 normal SHIPPED_LIVE RHUI 2.1 Enhancement Update 2012-08-24 15:52:31 UTC

Description Jay Dobies 2011-05-13 19:32:25 UTC
Previously the server was pinged before the attempt to login was made, allowing us to gracefully tell the user the server was down.

The pulp CLI was changed with respect to auth and now _all_ calls require auth credentials. That means the ping check won't work because the pulp CLI code won't even try to make the call without credentials.

I need to rework the login logic to do the ping after accepting/setting the credentials. Below is the code that used to do the ping. It's gotta get moved to the login call in pulp_api.py, throw an exception if the server is unavailable, catch that exception, and display a clean error message.

try:
   pulp_api.ping()
except:
   prompt.write('Could not connect to the RHUA at %s, check the log for more information' % config.get('rhua', 'hostname'))
   LOG.exception('Error connecting to the RHUA at [%s]' % config.get('rhua', 'hostname'))
   sys.exit(1)

Comment 1 wes hayutin 2011-06-06 21:15:34 UTC
added to rhui-20 tracker

Comment 2 Jay Dobies 2012-01-12 19:27:56 UTC
I'm punting this from 2.0.2.

The problem is in the pulp client lib that it requires auth for all calls. Need to fix this to allow ping without auth. Rather than do it now, I'd rather just wait until we make the big CLI changes for Pulp 2.0.

Comment 3 wes hayutin 2012-05-23 20:40:18 UTC
cloude commit 46ad38442e2a2a8784b95f16c251ea952267fc4e

Comment 4 mkovacik 2012-08-09 15:50:34 UTC
Created attachment 603294 [details]
Verifying screen log

Verified in RHEL-6.3-RHUI-2.1-20120801.0-Server-x86_64-DVD1.iso. Status -> Verified. See the screen log attached

Comment 5 Dan Macpherson 2012-08-14 02:33:54 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The pulp command line's authentication process has changed and now requires credentials for all system calls. As a consequence, a ping check before a login attempt does not work due to the lack of credentials. This fix allows ping attempts without authentication. The pulp command line now successfully pings before a login attempt.

Comment 7 errata-xmlrpc 2012-08-24 11:53:07 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.

http://rhn.redhat.com/errata/RHEA-2012-1205.html


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