Bug 810363 - Firstboot crashes when [re]registering using a bad proxy
Firstboot crashes when [re]registering using a bad proxy
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: rc
: ---
Assigned To: Adrian Likins
Entitlement Bugs
Depends On:
Blocks: 738066
  Show dependency treegraph
Reported: 2012-04-05 14:12 EDT by J.C. Molet
Modified: 2012-06-20 09:09 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-20 09:09:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
network error (281.06 KB, image/png)
2012-04-11 11:32 EDT, J.C. Molet
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0804 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2012-06-19 15:51:31 EDT

  None (edit)
Description J.C. Molet 2012-04-05 14:12:08 EDT
Description of problem:
Firstboot completely crashes when [re]registering using a bad proxy.

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

How reproducible:

Steps to Reproduce:
1. Start firstboot and choose to register with the new rhn (uncheck classic mode)
2. Register your machine to the candlepin server with your user/pass
3. Click the back button twice
4. Click "Advanced Network Configuration"
5. Enter the name of a bogus proxy server (or make a typo) and click 'close'
6. Click 'forward' and try to re-register

Alternate steps:

1. Edit /etc/rhsm/rhsm.conf
2. Enter in bad values for the proxy server url
3. start firstboot
4. Try to register using new rhn 
Actual results:
Firstboot completely crashes:

executable:     /usr/bin/python
hashmarkername: firstboot
kernel:         2.6.32-220.4.1.el6.x86_64
reason:         gaierror: [Errno -2] Name or service not known
time:           Thu 05 Apr 2012 01:58:50 PM EDT

firstboot-tb-eAfJfH: Text file, 60344 bytes

:The following was filed automatically by firstboot:
:firstboot 1.110.11 exception report
:Traceback (most recent call last):
:  File "/usr/lib/python2.6/site-packages/firstboot/interface.py", line 105, in _nextClicked
:    self.advance()
:  File "/usr/lib/python2.6/site-packages/firstboot/interface.py", line 148, in advance
:    result = module.apply(self, self.testing)
:  File "/usr/share/rhn/up2date_client/firstboot/rhsm_login.py", line 118, in apply
:    managerlib.unregister(self.backend.uep, self.consumer.uuid)
:  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 791, in unregister
:    uep.unregisterConsumer(consumer_uuid)
:  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 654, in unregisterConsumer
:    return self.conn.request_delete(method)
:  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 399, in request_delete
:    return self._request("DELETE", method)
:  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 335, in _request
:    conn.request(request_type, handler, body=body, headers=headers)
:  File "/usr/lib64/python2.6/httplib.py", line 914, in request
:    self._send_request(method, url, body, headers)
:  File "/usr/lib64/python2.6/httplib.py", line 951, in _send_request
:    self.endheaders()
:  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 124, in endheaders
:    httpslib.HTTPSConnection.endheaders(self)
:  File "/usr/lib64/python2.6/httplib.py", line 908, in endheaders
:    self._send_output()
:  File "/usr/lib64/python2.6/httplib.py", line 780, in _send_output
:    self.send(msg)
:  File "/usr/lib64/python2.6/httplib.py", line 739, in send
:    self.connect()
:  File "/usr/lib64/python2.6/site-packages/M2Crypto/httpslib.py", line 169, in connect
:    HTTPConnection.connect(self)
:  File "/usr/lib64/python2.6/httplib.py", line 720, in connect
:    self.timeout)
:  File "/usr/lib64/python2.6/socket.py", line 553, in create_connection
:    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
:gaierror: [Errno -2] Name or service not known


Expected results:
You would get the normal "Network Error" dialog pop up that you would using normal subscription manager.

Additional info:
Comment 1 Adrian Likins 2012-04-09 12:54:27 EDT
Got a fix for catching this case and presenting an error message. It just shows the generic "there was some sort of network error" message, so that's not great, but it does keep it from crashing.
Comment 2 Adrian Likins 2012-04-09 17:05:43 EDT
commit 454497867fcde87b3fdf54e1a3b2d67eecee8706
Author: Adrian Likins <alikins@redhat.com>
Date:   Mon Apr 9 12:49:30 2012 -0400

    810363: handle socket errors for bad proxy host in firstboot
Comment 6 J.C. Molet 2012-04-11 11:32:24 EDT
Created attachment 576811 [details]
network error

[root@jmolet-vm0 ~]# rpm -qa | grep subscription-manager

I now get the attached network error for any generic proxy network error when using rhsm in firstboot.

Ive tried:
- bad hostname
- bad port
- bad authentication user/pass

All seems to work as expected.

marking VERIFIED.
Comment 8 errata-xmlrpc 2012-06-20 09:09:00 EDT
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.


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