Bug 1457197

Summary: --noproxy option no longer match "*" for host names
Product: Red Hat Enterprise Linux 7 Reporter: Rehana <redakkan>
Component: python-rhsmAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: bkearney, csnyder, jhnidek, khowell, redakkan, skallesh, yuefliu
Target Milestone: rcKeywords: EasyFix, Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-rhsm-1.19.9-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 19:24:36 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:

Description Rehana 2017-05-31 09:57:23 UTC
Description of problem:
Due to the recent fix for this bug 1443164 , no_proxy variable no longer honours "*" to match any hostname 

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

subscription management server: 2.1.1-1
subscription management rules: 5.23
subscription-manager: 1.19.17-1.el7
python-rhsm: 1.19.8-1.el7

How reproducible:
always


Steps to Reproduce:
1.set a bad proxy on the system

root@dhcp151-206 ~]# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = notarealproxy.example.com
   proxy_password = []
   proxy_port = 1100
   proxy_user = []

2. and try to register

[root@dhcp151-206 ~]# subscription-manager list --available --noproxy=*
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

3. [root@dhcp151-206 ~]# rpm -qa python-rhsm --changelog | grep 1443164
- 1443164: no_proxy match the host name when *.redhat.com is used



Actual results:
--noproxy=* doesnt match the hostname F21-candlepin.usersys.redhat.com

Expected results:
This used to work prior to the bug 1443164 fix

Additional info:
# subscription-manager version --noproxy=*
server type: Red Hat Subscription Management
subscription management server: 2.1.1-1
subscription management rules: 5.23
subscription-manager: 1.19.15-1.el7
python-rhsm: 1.19.6-1.el7


# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = notarealproxy.example.com
   proxy_password = []
   proxy_port = 1100
   proxy_user = []

# subscription-manager register --noproxy=* 
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: admin
The system has been registered with ID: e9cc23c5-4067-4949-b2e8-50165a7da6c8 

[root@ibm-x3250m3-01 ~]# rpm -qa python-rhsm --changelog | grep 1443164
[root@ibm-x3250m3-01 ~]#

Comment 2 Rehana 2017-05-31 10:46:28 UTC
Additional note:
==============

the issue is observed when used the subscription-manager "--noproxy" option , it seems to be working when NO_PROXY environment variable is used 

# NO_PROXY=* HTTPS_PROXY=https://bad:password@auto-services.usersys.redhat.com:3128 subscription-manager register --username=testuser1 --org=admin --force --serverurl=F21-candlepin.usersys.redhat.com:8443/candlepin
Unregistering from: F21-candlepin.usersys.redhat.com:8443/candlepin
The system with UUID 985fb963-510d-49c3-a257-5b0e2bb96d9d has been unregistered
All local data removed
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with ID: 26437820-0d63-4598-8f29-0e202071fdda 

PASSED : * matches the hostname

# NO_PROXY=*.redhat.com HTTPS_PROXY=https://bad:password@auto-services.usersys.redhat.com:3128 subscription-manager register --username=testuser1 --org=admin --force --serverurl=F21-candlepin.usersys.redhat.com:8443/candlepin
Unregistering from: F21-candlepin.usersys.redhat.com:8443/candlepin
The system with UUID 26437820-0d63-4598-8f29-0e202071fdda has been unregistered
All local data removed
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with ID: 11e22d2d-c3f8-481a-8df5-1ae575667961 

PASSED : *.redhat.com matches the hostname "F21-candlepin.usersys.redhat.com"


Also there is wrong paste in step 2 , it should have been a register out put like this

# subscription-manager register --noproxy=*
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = notarealproxy.example.com
   proxy_password = []
   proxy_port = 1100
   proxy_user = []

Comment 3 John Sefler 2017-06-02 00:11:36 UTC
(In reply to Rehana from comment #2)
> , it seems to be working when NO_PROXY environment variable is used 

Yes it seems to be working when NO_PROXY environment variable is used, but it is failing when no_proxy (lowercase) is used...


PASSING "NO_PROXY" CASE....

[root@jsefler-rhel7 ~]# NO_PROXY=* https_proxy=https://bad-username:redhat@auto-services.usersys.redhat.com:3128 subscription-manager register --username=qa --force
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
The system with UUID 3c7e3f72-1bf0-4971-8f98-0c39eaae8077 has been unregistered
All local data removed
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: 51aef4e5-c538-4994-9014-24202fe99847 


FAILING "no_proxy" CASE...

[root@jsefler-rhel7 ~]# no_proxy=* https_proxy=https://bad-username:redhat@auto-services.usersys.redhat.com:3128 subscription-manager register --username=qa --force
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

Comment 6 Rehana 2017-06-08 10:04:37 UTC
Reproducing the failure : 
======================

subscription-manager: 1.19.17-1.el7
python-rhsm: 1.19.8-1.el7

root@dhcp150-207 ~]# cat /etc/rhsm/rhsm.conf | grep proxy_
proxy_hostname ==notarealproxy.example.com
proxy_port =1100
proxy_user =
proxy_password =

[root@dhcp150-207 ~]# subscription-manager register --noproxy=* 
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

[root@dhcp150-207 ~]# no_proxy=* https_proxy=https://bad-username:redhat@auto-services.usersys.redhat.com:3128 subscription-manager register 
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

Verifying on :
=============

subscription-manager: 1.19.18-1.el7
python-rhsm: 1.19.9-1.el7


[root@dhcp150-207 ~]# cat /etc/rhsm/rhsm.conf | grep proxy_
proxy_hostname ==notarealproxy.example.com
proxy_port =1100
proxy_user =
proxy_password =

[root@dhcp150-207 ~]# subscription-manager register --noproxy=* 
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: admin
The system has been registered with ID: e7446ecc-b84d-420b-a210-ac694fe9b849 


with no_proxy ( lower case)  environment variable : 

[root@dhcp150-207 ~]# no_proxy=* https_proxy=https://bad-username:redhat@auto-services.usersys.redhat.com:3128 subscription-manager register 
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: admin

The system has been registered with ID: 84dd84d6-0135-48c8-90a7-3fb321a937bc 
[root@dhcp150-207 ~]# 

Observed that now both no_proxy(lower case ) --noproxy option  honours '*' to match any hostname .

Based on the above observations moving the bug to Verified!!!

Comment 7 Kevin Howell 2017-06-08 14:20:20 UTC
*** Bug 1459504 has been marked as a duplicate of this bug. ***

Comment 8 errata-xmlrpc 2017-08-01 19:24:36 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-2017:2083