Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 958182

Summary: Options Error: Error parsing '/http://example.com/awesomeos-modifier': URL must be http, ftp, file or https not ""
Product: [Community] Candlepin (Migrated to Jira) Reporter: John Sefler <jsefler>
Component: candlepinAssignee: Bryan Kearney <bkearney>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: high Docs Contact:
Priority: unspecified    
Version: 0.9CC: bkearney, omaciel
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-01 13:49:47 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: 840995    

Description John Sefler 2013-04-30 14:28:12 UTC
Description of problem:
Not sure what caused this regression, but it started appearing on 4/30/2013 during automation test runs with the TESTDATA deployed in an onpremise candlepin server.

An extraneous / is getting prepended to the baseurl of an entitlement from the modifier pool.  As a result, yum transactions are failing with the error message in the summary.




Version-Release number of selected component (if applicable):
[root@jsefler-5 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.4-1
subscription-manager: 1.8.6-1.git.7.96019b0.el5
python-rhsm: 1.8.9-1.git.7.214419e.el5

[root@jsefler-f14-candlepin candlepin]# git show-ref | grep master
6a04fbea2b76206db13a9d0bfe8d683c3aa0f667 refs/heads/master


How reproducible:


Steps to Reproduce:
1. register as testuser1 to org admin
2. consume the following entitlements...
[root@jsefler-5 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+

Subscription Name: Awesome OS Server Basic
Provides:          Awesome OS Server Bits
SKU:               awesomeos-server-basic
Contract:          12
Account:           12331131231
Serial Number:     8449685361101984675
Pool ID:           8a90f8313e472bce013e472d331007f0
Active:            True
Quantity Used:     1
Service Level:     None
Service Type:      Self-Support
Starts:            04/25/2013
Ends:              04/25/2014

Subscription Name: Awesome OS Modifier
Provides:          Awesome OS Modifier Bits
SKU:               awesomeos-modifier
Contract:          0
Account:           12331131231
Serial Number:     8287215980324639433
Pool ID:           8a90f8313e472bce013e472d33dd083e
Active:            True
Quantity Used:     1
Service Level:     
Service Type:      
Starts:            04/25/2013
Ends:              04/25/2014

[root@jsefler-5 ~]# yum repolist
WARNING:rhsm-app.subscription_manager.isodate:dateutil module not found, trying pyxml
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
Options Error: Error parsing '/http://example.com/awesomeos-modifier': URL must be http, ftp, file or https not ""


BANG!
Did NOT expect the Options Error.


Additional info:
[root@jsefler-5 ~]# subscription-manager repos --list | grep awesomeos-modifier -A2
Repo ID:   awesomeos-modifier
Repo Name: awesomeos-modifier
Repo URL:  /http://example.com/awesomeos-modifier
Enabled:   1

The Repo URL should NOT be prepended with a slash.

[root@jsefler-5 ~]# rct cat-cert /etc/pki/entitlement/8287215980324639433.pem | grep awesomeos-modifier
	SKU: awesomeos-modifier
	Name: awesomeos-modifier
	Label: awesomeos-modifier
	URL: /http://example.com/awesomeos-modifier
	GPG: http://example.com/awesomeos-modifier/gpg

The bad slash appears to be comming from the granted entitlement.

This is probably a candlpin bug.

Comment 1 Bryan Kearney 2013-04-30 20:19:56 UTC
The prefix request from katello caused this. I think the test data is bad, but this will fix it just in case.

https://github.com/candlepin/candlepin/pull/240

Comment 2 Bryan Kearney 2013-05-01 17:40:52 UTC
Fixed in :

commit 76d933703a9f7b52b5c06e91421013440ed5f207
Author: Bryan Kearney <bkearney>
Date:   Tue Apr 30 16:09:50 2013 -0400

    958182: Fix the prefix logic to not append hte prefix if the url starts with a normal url prefix



Note, we are explicitly treating a full url as GIGO. So, it will not fix:

http://this/is/a//bad/url

-- bk

Comment 3 John Sefler 2013-06-07 17:01:03 UTC
Verifying version...
[root@jsefler-5 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.13-1
subscription-manager: 1.8.10-1.el5
python-rhsm: 1.8.12-1.el5
[root@jsefler-f14-candlepin candlepin]# git show-ref | grep master
fa4a5b2d43743be2c597e0d081173e505dbb6690 refs/heads/master


[root@jsefler-5 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Modifier
Provides:          Awesome OS Modifier Bits
SKU:               awesomeos-modifier
Contract:          1
Account:           12331131231
Serial:            8180361165221268050
Pool ID:           8a90f8df3f19d2bc013f19d528ae03d0
Active:            True
Quantity Used:     1
Service Level:     
Service Type:      
Status Details:    
Starts:            06/05/2013
Ends:              06/05/2014

Subscription Name: Awesome OS Server Basic
Provides:          Awesome OS Server Bits
SKU:               awesomeos-server-basic
Contract:          13
Account:           12331131231
Serial:            7086714794081621136
Pool ID:           8a90f8df3f19d2bc013f19d52a0d0419
Active:            True
Quantity Used:     1
Service Level:     None
Service Type:      Self-Support
Status Details:    
Starts:            06/05/2013
Ends:              06/05/2014

[root@jsefler-5 ~]# 
[root@jsefler-5 ~]# yum repolist
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
This system is not registered with RHN Classic or RHN Satellite.
You can use rhn_register to register.
RHN Satellite or RHN Classic support will be disabled.
https://cdn.redhat.com/foo/path/always/5Server/repodata/repomd.xml: [Errno 14] HTTP Error 403: Forbidden
Trying other mirror.
repo id                              repo name                            status
always-enabled-content               always-enabled-content               0
awesomeos-modifier                   awesomeos-modifier                   0
content-label                        content                              0
content-label-empty-gpg              content-emptygpg                     0
content-label-no-gpg                 content-nogpg                        0
repolist: 0
[root@jsefler-5 ~]# 

[root@jsefler-5 ~]# rct cat-cert /etc/pki/entitlement/8180361165221268050.pem | grep awesomeos-modifier
	SKU: awesomeos-modifier
	Name: awesomeos-modifier
	Label: awesomeos-modifier
	URL: http://example.com/awesomeos-modifier
	GPG: http://example.com/awesomeos-modifier/gpg

VERIFIED: no more misplaced / leading the URL