Hide Forgot
Description of problem: virt-who got exception when connecting to candlepin (stage env) cc jomara as this may need IT to help solve. Version-Release number of selected component (if applicable): virt-who-0.2-1.1.el6.noarch subscription-manager-0.96.8-1.el6.x86_64 python-rhsm-0.96.10-1.el6.noarch How reproducible: always Steps to Reproduce: 1. run virt-who # virt-who 2. 3. Actual results: Traceback (most recent call last): File "/usr/share/virt-who/virt-who.py", line 69, in <module> subscriptionManager.connect() File "/usr/share/virt-who/subscriptionmanager.py", line 56, in connect if not self.connection.ping()['result']: File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 406, in ping return self.conn.request_get("/status/") File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 258, in request_get return self._request("GET", method) File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 224, in _request self.validateResponse(result) File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 240, in validateResponse raise RemoteServerException(response['status']) rhsm.connection.RemoteServerException Expected results: Additional info: #/usr/lib/python2.6/site-packages/rhsm/connection.py def ping(self, username=None, password=None): return self.conn.request_get("/status/") GET /subscription/status/ {'content': '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n<head>\n <meta http-equiv="content-type" content="text/html;charset=UTF-8" />\n <title>404 Not Found</title>\n <link href="/clonepin/stylesheets/scaffold.css?1315018846" media="screen" rel="stylesheet" type="text/css" />\n <link href="/clonepin/stylesheets/errorpage.css?1315018846" media="screen" rel="stylesheet" type="text/css" />\n</head>\n<body>\n\n <div class="dialog">\n <h1>The page you were looking for doesn\'t exist.</h1>\n <p>You may have mistyped the address or the page may have moved.</p>\n </div>\n\n\n</body>\n</html>\n', 'status': 404}
Are you sure that your rhsm configuration is correct? Do you have your system registered? Can you show your rhsm configuration? Maybe change prefix=/subscription to prefix=/candlepin in /etc/rhsm/rhsm.conf can help.
Created attachment 521498 [details] rhsm.conf
(In reply to comment #2) > Are you sure that your rhsm configuration is correct? Do you have your system > registered? Can you show your rhsm configuration? Maybe change > prefix=/subscription to prefix=/candlepin in /etc/rhsm/rhsm.conf can help. It should be correct. For stage env, we use /subscription instead of /candlepin. I can register/subscribe using subscription-manager. rhsm.conf is attached https://bugzilla.redhat.com/attachment.cgi?id=521498. GET /candlepin/status/ {'content': '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL /candlepin/status/ was not found on this server.</p>\n<hr>\n<address>Apache Server at subscription.rhn.stage.redhat.com Port 443</address>\n</body></html>\n', 'status': 404}
My system is registered. Otherwise, I couldn't use virt-who. subscription-manger has exception handling which catches the exception when getting /subscription/status/. That's why I could use subscription-manager to register/subscribe.
> subscription-manger has exception handling which catches the exception when getting /subscription/status/ Where do you get this information? I can't find it in subscription-manager code.
(In reply to comment #7) > > subscription-manger has exception handling which catches the exception when > getting /subscription/status/ > > Where do you get this information? I can't find it in subscription-manager > code. You are right, it has no exception handling for GET /subscription/status/ (the ping cmd). Sorry, I meant to say it had for GET /subscription/. #connection.py def _load_supported_resources(self): """ Load the list of supported resources by doing a GET on the root of the web application we're configured to use. Need to handle exceptions here because sometimes UEPConnections are created in a state where they can't actually be used. (they get replaced later) If something goes wrong making this request, just leave the list of supported resources empty. """ self.resources = {} try: resources_list = self.conn.request_get("/") for r in resources_list: self.resources[r['rel']] = r['href'] log.debug("Server supports the following resources:") log.debug(self.resources) # Handle situations where the UEPConnection isn't actually usable: except Exception, e: log.warn("Error fetching supported resources, this " "UEPConnection is likely not usable:") log.exception(e)
Since the /status/ might not be implemented sometimes, I'll put the ping command to exception block to avoid virt-who to fail.
Fixed in virt-who-0.3-2.el6.
Verified on virt-who-0.3-2.el6. PASS Steps: 1. enable virt-who debug option in /etc/sysconfig/ VIRTWHO_DEBUG=1 2. # service virt-who restart virt-who exited normally.
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-2011-1757.html