Bug 810363

Summary: Firstboot crashes when [re]registering using a bad proxy
Product: Red Hat Enterprise Linux 6 Reporter: J.C. Molet <jmolet>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3CC: alikins
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:09:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 738066    
Attachments:
Description Flags
network error none

Description J.C. Molet 2012-04-05 18:12:08 UTC
Description of problem:
Firstboot completely crashes when [re]registering using a bad proxy.

Version-Release number of selected component (if applicable):
subscription-manager-gnome-0.99.12-1.git.18.188dde8.el6.x86_64
subscription-manager-0.99.12-1.git.18.188dde8.el6.x86_64
subscription-manager-firstboot-0.99.12-1.git.18.188dde8.el6.x86_64
python-rhsm-0.99.7-1.git.1.e68bc91.el6.noarch

How reproducible:
always

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

description:
: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

END:

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 16:54:27 UTC
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 21:05:43 UTC
commit 454497867fcde87b3fdf54e1a3b2d67eecee8706
Author: Adrian Likins <alikins>
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 15:32:24 UTC
Created attachment 576811 [details]
network error

[root@jmolet-vm0 ~]# rpm -qa | grep subscription-manager
subscription-manager-migration-data-1.12.1.2-1.git.2.99d0c10.el6.noarch
subscription-manager-gnome-1.0.0-1.git.11.f42a186.el6.x86_64
subscription-manager-1.0.0-1.git.11.f42a186.el6.x86_64
subscription-manager-migration-1.0.0-1.git.11.f42a186.el6.x86_64
subscription-manager-firstboot-1.0.0-1.git.11.f42a186.el6.x86_64


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 13:09:00 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/RHBA-2012-0804.html