RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1546351 - A RHEL-7.5 client host cannot rhnreg_ks to a Satellite 5 server through a proxy
Summary: A RHEL-7.5 client host cannot rhnreg_ks to a Satellite 5 server through a proxy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Orsava
QA Contact: Mirek Długosz
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-16 20:49 UTC by John Sefler
Modified: 2018-05-17 16:02 UTC (History)
18 users (show)

Fixed In Version: python-2.7.5-67
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 15:00:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1483438 0 medium CLOSED A RHEL-7.4 client host cannot be registered to the Satellite server through a proxy server using bootstrap script. 2021-06-10 12:51:08 UTC
Red Hat Product Errata RHBA-2018:0833 0 None None None 2018-04-10 15:00:55 UTC

Internal Links: 1483438

Description John Sefler 2018-02-16 20:49:00 UTC
Description of problem:

The recent change in python-libs-2.7.5-66 to address bug 1483438 has broke rhnreg_ks ability to register to a Satellite 5 server through a proxy.

Note...
The following package combination from compose RHEL-7.5-Snapshot-3.1 was not a problem.
   python-libs-2.7.5-65.el7.x86_64.rpm  
   rhnlib-2.5.65-7.el7.noarch.rpm  

The following package combination from compose RHEL-7.5-Snapshot-4.0 causes the traceback seen in the reproducer steps below. 
   python-libs-2.7.5-66.el7.x86_64.rpm  
   rhnlib-2.5.65-7.el7.noarch.rpm  



Version-Release number of selected component (if applicable):
[root@hp-dl380pgen8-02-vm-2 ~]# rpm -q python-libs
python-libs-2.7.5-66.el7.x86_64
[root@hp-dl380pgen8-02-vm-2 ~]# 
[root@hp-dl380pgen8-02-vm-2 ~]# rpm -q --changelog python-libs | grep 2.7.5-66 -A2
* Fri Feb 09 2018 Charalampos Stratakis <cstratak> - 2.7.5-66
- Fix https connections behind a proxy.
Resolves: rhbz#1483438
[root@hp-dl380pgen8-02-vm-2 ~]# rpm -q --whatprovides /usr/lib/python2.7/site-packages/rhn/connections.py
rhnlib-2.5.65-7.el7.noarch
[root@hp-dl380pgen8-02-vm-2 ~]# rpm -q --whatprovides `which rhnreg_ks`
rhn-setup-2.0.2-21.el7.noarch


How reproducible:


Steps to Reproduce:
Configure /etc/sysconfig/rhn/up2date to use a valid proxy server when registering to a valid Sat5 server  (steps not shown)

[root@hp-dl380pgen8-02-vm-2 ~]# rhnreg_ks --serverUrl=https://rhsm-sat5.usersys.redhat.com/XMLRPC --username=rhsm-client --password=REDACTED --profilename=rhsm-automation.hp-dl380pgen8-02-vm-2.lab.bos.redhat.com --force --norhnsd --nohardware --nopackages --novirtinfo
An error has occurred:
<type 'exceptions.AttributeError'>
See /var/log/up2date for more information
[root@hp-dl380pgen8-02-vm-2 ~]# 
[root@hp-dl380pgen8-02-vm-2 ~]# tail -f /var/log/up2date
[Fri Feb 16 15:33:39 2018] up2date 
Traceback (most recent call last):
  File "/usr/sbin/rhnreg_ks", line 218, in <module>
    cli.run()
  File "/usr/share/rhn/up2date_client/rhncli.py", line 96, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhnreg_ks", line 90, in main
    rhnreg.getCaps()
  File "/usr/share/rhn/up2date_client/rhnreg.py", line 248, in getCaps
    s.capabilities.validate()
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 63, in __call__
    return rpcServer.doCall(method, *args, **kwargs)
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 204, in doCall
    ret = method(*args, **kwargs)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in __call__
    return self.__send(self.__name, args)
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 38, in _request1
    ret = self._request(methodname, params)
  File "/usr/lib/python2.7/site-packages/rhn/rpclib.py", line 384, in _request
    self._handler, request, verbose=self._verbose)
  File "/usr/lib/python2.7/site-packages/rhn/transports.py", line 147, in request
    connection = self.get_connection(host)
  File "/usr/lib/python2.7/site-packages/rhn/transports.py", line 327, in get_connection
    trusted_certs=self.trusted_certs)
  File "/usr/lib/python2.7/site-packages/rhn/connections.py", line 202, in __init__
    password, timeout=timeout)
  File "/usr/lib/python2.7/site-packages/rhn/connections.py", line 120, in __init__
    self._set_hostport(host, port)
<type 'exceptions.AttributeError'>: HTTPSProxyConnection instance has no attribute '_set_hostport'


Actual results:
  above

Expected results:
  successful registration using a valid proxy

Additional info:

Patch https://bugzilla.redhat.com/attachment.cgi?id=1392607 from bug 1483438 appears to have removed '_set_hostport' thereby breaking client tools like rhnreg_ks.

Comment 2 Tomas Lestach 2018-02-19 10:01:43 UTC
John, thank you for letting us know. Adding more people to CC of this BZ.

Is it possible to keep _set_hostport() available for compatibility reasons? It can be simplified, but it shouldn't be removed. I feel such interface shouldn't change between RHEL minor versions, as there may be many tools relying on that, like e.g. the registration piece for Satellite 5.

Comment 3 Petr Viktorin (pviktori) 2018-02-19 12:04:00 UTC
We'll see if it can be re-added.

In the future, use of private APIs should really be coordinated with maintainers, so a proper API can be added for the use case.

Comment 5 Tomas Orsava 2018-02-19 15:22:56 UTC
I patched Python to bring the old private API back, so _set_hostport() should work once again.

Build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=15336311
x86_64: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=15336313

Could I ask you, John, to test if this fixes your issue or help me setup a system so I can reproduce and test myself?

IMPORTANT: If we want to get this into RHEL 7.5, the deadline is this Wednesday.

Comment 9 Mirek Długosz 2018-02-23 14:41:21 UTC
Changing status to VERIFIED based on John's comment.

Comment 12 errata-xmlrpc 2018-04-10 15:00:08 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://access.redhat.com/errata/RHBA-2018:0833


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