Bug 856066

Summary: register with --serverurl=/10.70.1.62:8443 says "Unable to reach the server at subscription.rhn.redhat.com:443/10.70.1.62:8443/candlepin"
Product: Red Hat Enterprise Linux 5 Reporter: Shwetha Kallesh <skallesh>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED WONTFIX QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.9CC: bkearney, jmolet, jsefler, skallesh, spandey
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-09-17 19:32:57 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: 771748    

Description Shwetha Kallesh 2012-09-11 06:33:00 UTC
Description of problem:
 register with --serverurl=/10.70.1.62:8443 says "Unable to reach the server at subscription.rhn.redhat.com:443/10.70.1.62:8443/candlepin"

Version-Release number of selected component (if applicable):
[root@unused pki]# rpm -qa | grep subscription-manager
subscription-manager-gui-1.0.17-1.el5
subscription-manager-firstboot-1.0.17-1.el5
subscription-manager-1.0.17-1.el5
subscription-manager-migration-1.0.17-1.el5
subscription-manager-migration-data-1.11-1.el5
subscription-manager-debuginfo-1.0.17-1.el5


How reproducible:


Steps to Reproduce:
1.[root@unused pki]# subscription-manager register --serverurl=/10.70.1.62:8443/candlepin --org=admin --force
Unable to reach the server at subscription.rhn.redhat.com:443/10.70.1.62:8443/candlepin

2.
3.
  
Actual results:
Unable to reach the server at subscription.rhn.redhat.com:443/10.70.1.62:8443/candlepin


Expected results:
Unable to reach the server at /10.70.1.62:8443/candlepin


Additional info:

Comment 1 RHEL Program Management 2012-09-11 17:16:45 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 2 John Sefler 2012-09-14 12:10:38 UTC
[root@jsefler-rhel59 ~]# subscription-manager register --serverurl=/10.70.1.62:8443
Unable to reach the server at subscription.rhn.redhat.com:443/10.70.1.62:8443

[root@jsefler-rhel59 ~]# subscription-manager register --help | grep serverurl -A1
  --serverurl=SERVER_URL
                        server url in the form of https://hostname:443/prefix

The serverurl supplied was "/10.70.1.62:8443" which does NOT follow the format that the help statement requires.  Because the supplied value has a leading "/", subscription-manager is assuming that the value is entirely prefix and therefore it assumes the default hostname (subscription.rhn.redhat.com) and port (443) to assemble a fully qualified serverurl equal to "subscription.rhn.redhat.com:443/10.70.1.62:8443" and is then unable to reach the server.

In my opinion, this is not a bug and is properly working as designed.

Comment 3 Shwetha Kallesh 2012-09-17 04:57:40 UTC
[root@unused ~]# subscription-manager register --serverurl=//10.70.1.62:8443/candlepin --org=admin --force
Unable to reach the server at subscription.rhn.redhat.com:443//10.70.1.62:8443/candlepin

Even if I provide "//",it still assumes that the value is entirely prefix.I guess its designed to consider everything after "/" to be prefix.

Comment 4 Bryan Kearney 2012-09-17 19:32:57 UTC
agree with John, given that this is out of line with the help text I am not inclined to fix it. If you would like an RFE to validate the server url, please submit an RFE against RHEl 6. Thanks!