Bug 849494 - rhn-migrate-classic-to-rhsm fails when rhn/up2date is configured for a proxy
Summary: rhn-migrate-classic-to-rhsm fails when rhn/up2date is configured for a proxy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Alex Wood
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 771748
TreeView+ depends on / blocked
 
Reported: 2012-08-20 00:44 UTC by John Sefler
Modified: 2013-01-08 03:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Usage of the same variable name in rhn-migrate-classic-to-rhsm Consequence: Migration failed when RHN was configured to use a proxy. Fix: Remove the variable name collision. Result: Migration now works through a proxy.
Clone Of:
Environment:
Last Closed: 2013-01-08 03:59:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0033 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-01-08 08:38:27 UTC

Description John Sefler 2012-08-20 00:44:07 UTC
Description of problem:
rhn-migrate-classic-to-rhsm fails when rhn/up2date is configured for a proxy

Version-Release number of selected component (if applicable):
[root@kvm-guest-02 ~]# subscription-manager version
registered to: Unknown
server type: Unknown
subscription-manager: 1.0.14-1.git.2.b6ee391.el5
python-rhsm: 1.0.5-1.git.1.1ce0910.el5


How reproducible:


Steps to Reproduce:
### CONFIGURING RHSM.CONF FOR MIGRATION TO RHN STAGE ENVIRONMENT
[root@kvm-guest-02 ~]# subscription-manager config --server.hostname=subscription.rhn.stage.redhat.com --server.port=443 --server.prefix=/subscription
[root@kvm-guest-02 ~]# subscription-manager clean
All local data removed
### CONFIGURING A BASIC AUTH PROXY FOR RHN/UP2DATE....
[root@kvm-guest-02 ~]# sed -i 's/^enableProxy\s*=.*$/enableProxy=1/g' /etc/sysconfig/rhn/up2date
[root@kvm-guest-02 ~]# sed -i 's/^httpProxy\s*=.*$/httpProxy=http:\/\/auto-services.usersys.redhat.com:3128/g' /etc/sysconfig/rhn/up2date
[root@kvm-guest-02 ~]# sed -i 's/^enableProxyAuth\s*=.*$/enableProxyAuth=1/g' /etc/sysconfig/rhn/up2date
[root@kvm-guest-02 ~]# sed -i 's/^proxyUser\s*=.*$/proxyUser=redhat/g' /etc/sysconfig/rhn/up2date
[root@kvm-guest-02 ~]# sed -i 's/^proxyPassword\s*=.*$/proxyPassword=redhat/g' /etc/sysconfig/rhn/up2date
[root@kvm-guest-02 ~]# 
[root@kvm-guest-02 ~]# grep -i proxy /etc/sysconfig/rhn/up2date
enableProxyAuth[comment]=To use an authenticated proxy or not
enableProxyAuth=1
enableProxy[comment]=Use a HTTP Proxy
enableProxy=1
proxyPassword[comment]=The password to use for an authenticated proxy
proxyPassword=redhat
proxyUser[comment]=The username for an authenticated proxy
proxyUser=redhat
httpProxy[comment]=HTTP proxy in host:port format, e.g. squid.redhat.com:3128
httpProxy=http://auto-services.usersys.redhat.com:3128
[root@kvm-guest-02 ~]# 
### REGISTERING TO RHN HOSTED ON STAGE ENVIRONMENT
[root@kvm-guest-02 ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=****** --profilename=rhsm-automation.kvm-guest-02.rhts.eng.bos.redhat.com --force --norhnsd --nohardware --nopackages --novirtinfo
[root@kvm-guest-02 ~]# rhn-channel --list
rhel-x86_64-server-5
[root@kvm-guest-02 ~]# grep ID- /etc/sysconfig/rhn/systemid
<value><string>ID-1023062928</string></value>
[root@kvm-guest-02 ~]# 
### MIGRATING FROM RHN CLASSIC TO RED HAT SUBSCRIPTION MANAGEMENT (ON STAGE)
[root@kvm-guest-02 ~]# rhn-migrate-classic-to-rhsm
Red Hat account: qa
Password: 
Unable to authenticate to RHN Classic.  See /var/log/rhsm/rhsm.log for more details.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DID NOT EXPECT AUTHENTICATION TO FAIL



Additional info:

[root@kvm-guest-02 ~]# tail -f /var/log/rhsm/rhsm.log
2012-08-19 20:41:01,501 [INFO]  @rhn-migrate-classic-to-rhsm:385 - Using proxy auto-services.usersys.redhat.com:3128 - transferring settings to rhsm.conf
2012-08-19 20:41:01,503 [INFO]  @connection.py:490 - Using basic authentication as: qa
2012-08-19 20:41:01,503 [INFO]  @connection.py:511 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2012-08-19 20:41:01,504 [DEBUG]  @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-08-19 20:41:01,504 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-08-19 20:41:01,505 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-08-19 20:41:01,505 [DEBUG]  @connection.py:329 - Using proxy: auto-services.usersys.redhat.com:3128
2012-08-19 20:41:01,506 [DEBUG]  @connection.py:344 - Making request: GET https://subscription.rhn.stage.redhat.com:443/subscription/users/qa%40redhat.com/owners
2012-08-19 20:41:02,921 [DEBUG]  @connection.py:357 - Response status: 200
2012-08-19 20:41:02,922 [INFO]  @rhn-migrate-classic-to-rhsm:311 - Using proxy auto-services.usersys.redhat.com:3128 for RHN API methods
2012-08-19 20:41:02,923 [ERROR]  @rhn-migrate-classic-to-rhsm:319 - Traceback (most recent call last):
  File "/usr/sbin/rhn-migrate-classic-to-rhsm", line 316, in connectToRhn
    sk = sc.auth.login(credentials.username, credentials.password)
AttributeError: 'str' object has no attribute 'username'

Comment 2 Alex Wood 2012-08-21 19:31:19 UTC
commit f3bac76bf0a3a139e8ecfb6179a47e7e5f104f5a
Refs: <origin/awood/849494>, awood/849494, subscription-manager-1.0.14-1-3-gf3b~
Author:     Alex Wood <awood>
AuthorDate: Mon Aug 20 12:52:26 2012 -0400
Commit:     Alex Wood <awood>
CommitDate: Mon Aug 20 12:54:37 2012 -0400

    849494: Fix variable name collision.

Comment 4 John Sefler 2012-08-31 20:19:03 UTC
Verifying Version...

[root@jsefler-59server ~]# rpm -q subscription-manager-migration python-rhsm
subscription-manager-migration-1.0.17-1.el5
python-rhsm-1.0.7-1.el5

### CONFIGURING RHSM.CONF FOR MIGRATION TO RHN STAGE ENVIRONMENT...
[root@jsefler-59server ~]# subscription-manager config --server.hostname=subscription.rhn.stage.redhat.com
[root@jsefler-59server ~]# subscription-manager clean
All local data removed

### CONFIGURING A BASIC AUTH PROXY FOR RHN/UP2DATE...
[root@jsefler-59server ~]# sed -i 's/^enableProxy\s*=.*$/enableProxy=1/g' /etc/sysconfig/rhn/up2date
[root@jsefler-59server ~]# sed -i 's/^httpProxy\s*=.*$/httpProxy=http:\/\/auto-services.usersys.redhat.com:3128/g' /etc/sysconfig/rhn/up2date
[root@jsefler-59server ~]# sed -i 's/^enableProxyAuth\s*=.*$/enableProxyAuth=1/g' /etc/sysconfig/rhn/up2date
[root@jsefler-59server ~]# sed -i 's/^proxyUser\s*=.*$/proxyUser=redhat/g' /etc/sysconfig/rhn/up2date
[root@jsefler-59server ~]# sed -i 's/^proxyPassword\s*=.*$/proxyPassword=redhat/g' /etc/sysconfig/rhn/up2date
[root@jsefler-59server ~]# 
[root@jsefler-59server ~]# grep -i proxy /etc/sysconfig/rhn/up2date
enableProxyAuth[comment]=To use an authenticated proxy or not
enableProxyAuth=1
enableProxy[comment]=Use a HTTP Proxy
enableProxy=1
proxyPassword[comment]=The password to use for an authenticated proxy
proxyPassword=redhat
proxyUser[comment]=The username for an authenticated proxy
proxyUser=redhat
httpProxy[comment]=HTTP proxy in host:port format, e.g. squid.redhat.com:3128
httpProxy=http://auto-services.usersys.redhat.com:3128
[root@jsefler-59server ~]# 

### REGISTERING TO RHN HOSTED ON STAGE ENVIRONMENT...
[root@jsefler-59server ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa --password=**** --profilename=rhsm-automation --force --norhnsd --nohardware --nopackages --novirtinfo
[root@jsefler-59server ~]# rhn-channel --list
rhel-x86_64-server-5
[root@jsefler-59server ~]# grep ID- /etc/sysconfig/rhn/systemid
<value><string>ID-1023064203</string></value>

### MIGRATING FROM RHN CLASSIC TO RED HAT SUBSCRIPTION MANAGEMENT (ON STAGE)...
[root@jsefler-59server ~]# rhn-migrate-classic-to-rhsm
Red Hat account: qa
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to these RHN Classic Channels:
+----------------------------------+
rhel-x86_64-server-5

+--------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+--------------------------------------------------+
rhel-x86_64-server-5

Product certificates installed successfully to /etc/pki/product.

Preparing to unregister system from RHN Classic ...
System successfully unregistered from RHN Classic.

Attempting to register system to Red Hat Subscription Management ...
The system has been registered with id: 59b55eab-17c1-40b2-9a6c-4d63973f5ed3 
System 'jsefler-59server.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

Attempting to auto-subscribe to appropriate subscriptions ...
Installed Product Current Status:
Product Name:         	Red Hat Enterprise Linux Server
Status:               	Subscribed


Please visit https://access.redhat.com/management/consumers/59b55eab-17c1-40b2-9a6c-4d63973f5ed3 to view the details, and to make changes if necessary.

[root@jsefler-59server ~]# grep proxy /etc/rhsm/rhsm.conf
# an http proxy server to use
proxy_hostname =auto-services.usersys.redhat.com
# port for http proxy server
proxy_port =3128
# user name for authenticating to an http proxy, if needed
proxy_user =redhat
# password for basic http proxy auth, if needed
proxy_password =redhat


^^^ VERIFIED: The migration succeeded AND transferred the proxy information from /etc/sysconfig/rhn/up2date to /etc/rhsm/rhsm.conf

Comment 6 errata-xmlrpc 2013-01-08 03:59:28 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.

http://rhn.redhat.com/errata/RHBA-2013-0033.html


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