Bug 1390688 - global name 'socket' is not defined
Summary: global name 'socket' is not defined
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-rhsm
Version: 6.9
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: rc
: ---
Assignee: Kevin Howell
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-01 16:38 UTC by John Sefler
Modified: 2017-03-21 10:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 10:56:46 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github candlepin python-rhsm pull 187 None None None 2016-11-02 21:10:48 UTC
Red Hat Product Errata RHSA-2017:0698 normal SHIPPED_LIVE Moderate: subscription-manager security, bug fix, and enhancement update 2017-03-21 12:39:12 UTC

Description John Sefler 2016-11-01 16:38:52 UTC
Description of problem:
subscription-manager cli command are are encountering "global name 'socket' is not defined" errors.

I suspect something bad from this recent commit to python-rhsm

https://github.com/candlepin/python-rhsm/commit/214103dcffce29e31858ffee414d79c1b8063970


Version-Release number of selected component (if applicable):
[root@jsefler-rhel6workstation ~]# rpm -q python-rhsm subscription-manager
python-rhsm-1.18.4-1.git.1.214103d.el6.x86_64
subscription-manager-1.18.3-1.git.0.128fd0e.el6.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel6workstation ~]# subscription-manager register
Registering to: jsefler-candlepin6.usersys.redhat.com:8443/candlepin
Username: testuser1
Password: 
global name 'socket' is not defined
[root@jsefler-rhel6workstation ~]# 

Actual results:
global name 'socket' is not defined

Expected results:

Additional info:

Comment 3 John Sefler 2016-11-09 18:16:46 UTC
[root@jsefler-6server ~]# subscription-manager register --username=testuser1 --org=admin
Registering to: jsefler-candlepin6.usersys.redhat.com:8443/candlepin
Password: 
global name 'socket' is not defined
[root@jsefler-6server ~]# 


[root@jsefler-6server ~]# tail -f /var/log/rhsm/rhsm.log
2016-11-09 13:10:21,548 [DEBUG] subscription-manager:17218:MainThread @https.py:59 - Using m2crypto wrappers to provide httplib and ssl
2016-11-09 13:10:21,670 [DEBUG] subscription-manager:17218:MainThread @ga_loader.py:89 - ga_loader GaImporterGtk2
2016-11-09 13:10:21,675 [DEBUG] subscription-manager:17218:MainThread @plugins.py:569 - loaded plugin modules: []
2016-11-09 13:10:21,675 [DEBUG] subscription-manager:17218:MainThread @plugins.py:570 - loaded plugins: {}
2016-11-09 13:10:21,675 [DEBUG] subscription-manager:17218:MainThread @identity.py:131 - Loading consumer info from identity certificates.
2016-11-09 13:10:21,676 [DEBUG] subscription-manager:17218:MainThread @identity.py:146 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
2016-11-09 13:10:21,716 [INFO] subscription-manager:17218:MainThread @managercli.py:388 - Client Versions: {'python-rhsm': '1.18.4-1.git.1.214103d.el6', 'subscription-manager': '1.18.4-1.el6'}
2016-11-09 13:10:21,717 [INFO] subscription-manager:17218:MainThread @connection.py:754 - Connection built: host=jsefler-candlepin6.usersys.redhat.com port=8443 handler=/candlepin auth=identity_cert ca_dir=/etc/rhsm/ca/ verify=False
2016-11-09 13:10:21,718 [INFO] subscription-manager:17218:MainThread @connection.py:754 - Connection built: host=jsefler-candlepin6.usersys.redhat.com port=8443 handler=/candlepin auth=none
2016-11-09 13:10:21,719 [INFO] subscription-manager:17218:MainThread @managercli.py:388 - Client Versions: {'python-rhsm': '1.18.4-1.git.1.214103d.el6', 'subscription-manager': '1.18.4-1.el6'}
2016-11-09 13:10:21,734 [INFO] subscription-manager:17218:MainThread @managercli.py:363 - Consumer Identity name=None uuid=None
2016-11-09 13:10:21,774 [INFO] subscription-manager:17218:MainThread @managercli.py:363 - Consumer Identity name=None uuid=None
2016-11-09 13:10:21,775 [INFO] subscription-manager:17218:MainThread @connection.py:754 - Connection built: host=jsefler-candlepin6.usersys.redhat.com port=8443 handler=/candlepin auth=basic username=testuser1
2016-11-09 13:10:21,792 [DEBUG] subscription-manager:17218:MainThread @hwprobe.py:580 - cpu info: {'cpu.cpu(s)': 2, 'cpu.core(s)_per_socket': 1, 'cpu.thread(s)_per_core': 1, 'cpu.topology_source': 'kernel /sys cpu sibling lists', 'cpu.cpu_socket(s)': 2}
2016-11-09 13:10:21,969 [DEBUG] subscription-manager:17218:MainThread @hwprobe.py:808 - Running 'virt-what'
2016-11-09 13:10:21,993 [DEBUG] subscription-manager:17218:MainThread @hwprobe.py:812 - virt-what stdout: kvm

2016-11-09 13:10:21,993 [DEBUG] subscription-manager:17218:MainThread @hwprobe.py:813 - virt-what stderr: 
2016-11-09 13:10:22,007 [INFO] subscription-manager:17218:MainThread @hwprobe.py:918 - collected virt facts: virt.is_guest=True, virt.host_type=kvm, virt.uuid=D9DC25B0-F7D4-464A-80ED-166E0D61CCE4
2016-11-09 13:10:22,009 [DEBUG] subscription-manager:17218:MainThread @connection.py:444 - Loaded CA certificates from /etc/rhsm/ca/: jsefler-candlepin6.pem, timeout_listener.pem, redhat-uep.pem
2016-11-09 13:10:22,010 [DEBUG] subscription-manager:17218:MainThread @connection.py:488 - Making request: GET /candlepin/
2016-11-09 13:10:22,051 [ERROR] subscription-manager:17218:MainThread @managercli.py:176 - Error during registration: global name 'socket' is not defined
2016-11-09 13:10:22,051 [ERROR] subscription-manager:17218:MainThread @managercli.py:177 - global name 'socket' is not defined
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 1141, in _do_command
    self.options.environment)
  File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 1243, in _get_environment_id
    supports_environments = cp.supports_resource('environments')
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 780, in supports_resource
    self._load_supported_resources()
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 767, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 619, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 506, in _request
    except socket.error, e:
NameError: global name 'socket' is not defined

Comment 5 Shwetha Kallesh 2016-11-25 12:02:36 UTC
Dont see that error now with following version

[root@dhcp35-179 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.21-1
subscription management rules: 5.20
subscription-manager: 1.18.5-1.el6
python-rhsm: 1.18.5-1.el6


[root@dhcp35-179 ~]# subscription-manager register --force --serverurl shwetha-workstation.usersys.redhat.com:8443/candlepin
Registering to: shwetha-workstation.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: admin
The system has been registered with ID: cef36646-95c7-44ae-ac53-690fae803073

Comment 7 errata-xmlrpc 2017-03-21 10:56:46 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/RHSA-2017-0698.html


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