Hide Forgot
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:
[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
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
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