Bug 678003 - When using subscription manager with aproxy, yum should be configured with that same proxy information
Summary: When using subscription manager with aproxy, yum should be configured with th...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Devan Goodwin
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: 568421
TreeView+ depends on / blocked
 
Reported: 2011-02-16 13:29 UTC by Bryan Kearney
Modified: 2011-05-19 13:39 UTC (History)
4 users (show)

Fixed In Version: subscription-manager-0.95.3-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:39:50 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2011:0611 0 normal SHIPPED_LIVE new package: subscription-manager 2011-05-18 17:56:21 UTC

Description Bryan Kearney 2011-02-16 13:29:04 UTC
The user had configured RHSM to run via a proxy. However, yum was not configured to use the same proxy. This causes issues with becomeing compliant in the gui but not in the cli.

Comment 2 Devan Goodwin 2011-02-16 17:49:03 UTC
Can you elaborate briefly on the issues between GUI and CLI? Not sure why they would behave differently.

It looks like yum has both a global proxy configuration setting, but can also specify on a per-repo basis. Would you expect this change in RHSM to be placed in global yum.conf, or just in our repo definitions in /etc/yum.repos.d/redhat.repo? It feels a little risky to start playing with the global yum.conf, but adding the proxy setting to each entry in redhat.repo feels much more reasonable to me.

Comment 3 Pablo Iranzo Gómez 2011-02-16 17:57:52 UTC
Devan,

I tested putting the proxy line in global config, but using rhsm custom repos would be smarter just to avoid messing up with other configurations.

On my tests, using GUI was able to register system but not to subscribe it (after setting proxy on gui option).

Using cli using proxy option I was able to get registered and subscribed fine.

After tweaking yum.conf for inclusion of proxy line, it even worked on GUI.

I can redeploy the machine to retest if you want me to.

Regards
Pablo

Comment 4 Devan Goodwin 2011-02-16 18:12:09 UTC
Thanks Pablo, just a few more questions from you, I'm still not sure why either of these operations would invoke yum, if the issue was yum proxy settings I think it would only surface when you went to start installing software.

First of all though, am I correct that you were essentially trying to register with auto-subscribe in both cases? Or was this a manual subscribe?

Did you manually invoke yum or use packagekit after registration/entitlement?

When running the GUI, did you try once without proxy settings, see it fail, then set the proxy settings and try again? (just trying to establish if there could be a bad cached connection involved, the difference in behavior is making me wonder)

Were any visible error messages printed out? 

Thanks.

Comment 6 Pablo Iranzo Gómez 2011-02-18 18:24:23 UTC
Sorry for the delay Devan,

>First of all though, am I correct that you were essentially trying to register
>with auto-subscribe in both cases? Or was this a manual subscribe?

First try was manual two-step subscribing on GUI, second was autosubscribe

On commandline only autosubscribe was tried.

I used yum to invoke upgrade.

In the gui I first configured proxy, then tried.

I'll redeploy this machine next week and capture any information provided (screenshots, messages, etc).

Regards
Pablo

Comment 7 Pablo Iranzo Gómez 2011-02-18 18:56:12 UTC
I couldn't resist...

On this second try:

Installed EL6 on VM.

After finishing (install was made in text mode), I define a new repo  for CDROM and then groupinstall X window and Gnome desktop

Change runlevel to 5

last setup steps appear in graphical mode (firstboot)

Enter my session

Setup network manager to auto connect to eth0

Launch subscription manager gui from the tray icon.
The remaining steps are on zipped screenshots by ascending filename.

Regards
Pablo

Comment 8 Pablo Iranzo Gómez 2011-02-18 18:58:46 UTC
Screenshoots:

http://dl.dropbox.com/u/3893782/screenshoot.tar.gz

PD: Let me know when I can delete them

Comment 9 Devan Goodwin 2011-02-21 14:09:04 UTC
Ok I have them, feel free to delete. Thanks.

So you selected the subscription in the compliance assistant, hit subscribe, and then immediately got the network error within RHSM? This is the error that triggered this original bug report? 

Do you have the output from rhsm.log the error message talks about?

Did your system actually get an entitlement? (you would be able to see this in the GUI on the My Subscriptions tab)

I am still unclear why this bug mentioned yum, I've checked with the team and none of us can think of how yum would even be invoked within RHSM and cause this error. Any more insight on why yum was suspected to be the problem here?

Sorry for all the questions just trying to figure out what is going on. Thanks. :)

Comment 10 Pablo Iranzo Gómez 2011-02-22 07:34:24 UTC
Devan:

- On first capture, I hit Become compliant (bigger button) it asked me to register first

- Before registering, I configured proxy (2nd screenshoot)

- Enter registration data (3rd)

- Tried to become compliant and all products got listed and then click on 'Subscribe' (pantallazo-3)

- Then the network error appeared (pantallazo-4)

- Clicked again on become compliant but only product appeared, not subscriptions (pantallazo-5).

On a terminal, I've tried to yum upgrade but nothing worked (that's why asked on irc and this BZ was opened). 

System now appears as 'compliant'

Full logs are in:
http://dl.dropbox.com/u/3893782/rhsmcertd.log
http://dl.dropbox.com/u/3893782/rhsm.log

And well, yum (PackageKit) still complains about not contacting source so it's disabling them.

The first vm I've created and configured yum manually today downloaded two updates.

And please, keep going on with questions :)

Comment 11 Devan Goodwin 2011-02-22 14:02:24 UTC
Ok excellent description, thanks.

So we have two separate issues, it appears a bad connection is being cached or proxy settings are not being respected. Some of RHSM's requests are making it through to the server, but somewhere in compliance assistant after hitting subscribe it looks like they may not be getting used. Trying to reproduce but haven't found a way yet, it may be a very specific path through the screens.


2011-02-18 19:52:19,769 [INFO] _request() @connection.py:147 - loading ca pem certificates from: /etc/rhsm/ca/
2011-02-18 19:52:19,770 [INFO] _load_ca_certificates() @connection.py:134 - loading ca certificate '/etc/rhsm/ca/redhat-uep.pem'
2011-02-18 19:52:19,771 [INFO] _request() @connection.py:149 - work in insecure mode ?:False
2011-02-18 19:52:19,772 [INFO] _request() @connection.py:156 - using proxy 192.168.122.1:8118
2011-02-18 19:52:19,772 [INFO] _request() @connection.py:163 - handler: https://subscription.rhn.redhat.com:443/subscription/consumers/2b3fd7a2-4b9b-4e7c-9af1-9d42c2e504a3/entitlements?pool=8a85f98
12e264610012e2d8f6334184c
2011-02-18 19:52:29,387 [INFO] _request() @connection.py:177 - status code: 200
2011-02-18 19:52:29,393 [INFO] _request() @connection.py:147 - loading ca pem certificates from: /etc/rhsm/ca/
2011-02-18 19:52:29,393 [INFO] _load_ca_certificates() @connection.py:134 - loading ca certificate '/etc/rhsm/ca/redhat-uep.pem'
2011-02-18 19:52:29,394 [INFO] _request() @connection.py:149 - work in insecure mode ?:False
2011-02-18 19:52:29,402 [ERROR] fetch_certificates() @managergui.py:181 - Socket error: [Errno -2] Nombre o servicio desconocido Nombre o servicio desconocido
2011-02-18 19:52:29,403 [ERROR] handle_gui_exception() @utils.py:43 - [Errno -2] Nombre o servicio desconocido
Traceback (most recent call last):
  File "/usr/share/rhsm/gui/managergui.py", line 175, in fetch_certificates
    result = backend.certlib.update()
  File "/usr/share/rhsm/certlib.py", line 60, in update
    return action.perform()
  File "/usr/share/rhsm/certlib.py", line 132, in perform
    expected = self.getExpected(report)
  File "/usr/share/rhsm/certlib.py", line 189, in getExpected
    exp = self.getCertificateSerialsList()
  File "/usr/share/rhsm/certlib.py", line 182, in getCertificateSerialsList
    reply = self.uep.getCertificateSerials(self._getConsumerId())
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 365, in getCertificateSerials
    return self.conn.request_get(method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 200, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 169, in _request
    headers=self.headers)
  File "/usr/lib64/python2.6/httplib.py", line 910, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.6/httplib.py", line 947, in _send_request
    self.endheaders()
  File "/usr/lib64/python2.6/httplib.py", line 904, in endheaders
    self._send_output()
  File "/usr/lib64/python2.6/httplib.py", line 776, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.6/httplib.py", line 735, in send
    self.connect()
  File "/usr/lib64/python2.6/site-packages/M2Crypto/httpslib.py", line 50, in connect
    self.sock.connect((self.host, self.port))
  File "/usr/lib64/python2.6/site-packages/M2Crypto/SSL/Connection.py", line 181, in connect
    self.socket.connect(addr)
  File "<string>", line 1, in connect
gaierror: [Errno -2] Nombre o servicio desconocido
2011-02-18 19:52:37,614 [DEBUG] _reload_screen() @compliance.py:203 - reloading screen
2011-02-18 19:52:37,615 [DEBUG] _reload_screen() @compliance.py:209 - using noncompliance date: 2011-02-18 19:52:37-01:00



Second issue, we need to add proxy settings to the yum repos we generate in redhat.repo. We also need to make sure these get updated when proxy settings are changed, even if nothing else has changed with the underlying entitlement certificates.

Comment 12 Pablo Iranzo Gómez 2011-02-23 06:58:29 UTC
Thanks Devan!
Pablo

Comment 13 Devan Goodwin 2011-02-25 19:23:19 UTC
Fix bad cached connection in:

master: 75a9d72eed65c7940d560c13801c5b8b7144723e
RHEL6: 6bbd83a454ca51d5f3a75dc17a89e7dbe489d1f9

Write proxy info for yum repositories:

master: 10ab449a0df40c544a9526a4155321dbb9ed3d5d
RHEL6: 38fececd0c31f68db021a361ade992c038570eb3

These fixes should appear in:

master: subscription-manager-0.96.2-1
RHEL6: subscription-manager-0.95.3-1

Comment 16 John Sefler 2011-04-08 14:39:02 UTC
Devan and Pablo,
I'd like to get this bugzilla VERIFIED, but the re-create path is not clear.

1. Pablo, were you able to verify that Devan's fixes fixed your original problem?  If yes, then can you move this bugzilla to VERIFIED?

2. Devan, we have a basic auth and no-auth proxy server running in our test environment.  If you can lay out a scenario (cli and/or gui) to follow, then jmolet and I can use it to verify this bug and possibly create an automated regression test for this bug.

Thanks,
John Sefler

Comment 17 Devan Goodwin 2011-04-08 18:55:35 UTC
Tough one, trying to remember best I can, apologies for not clearly noting it originally.

For the cached connection problem, I think you need a proxy setup and configured, but it needs to be the only way you can reach the Candlepin server from the system where RHSM is being run, i.e. request without using proxy settings must fail. If you have this environment setup you would:

- Start RHSM GUI (unregistered)
- Setup proxy in advanced config.
- Register.
- Open Compliance Assistant (be sure *not* to restart GUI between this)

The bug here was the connection was not getting refreshed to use the proxy settings. Registration would work, but Compliance Assistant still had a reference to an old connection.

For the second part of the bug, I think you just need to verify that having setup proxy options in RHSM, your yum repos in /etc/yum.repod.d/redhat.repo have proxy info associated with each of them.

Comment 18 Pablo Iranzo Gómez 2011-04-11 12:08:00 UTC
@John:

I would need to recreate the system and get the upgrade from the errata installed before doing the test.

¿There's a new iso to reinstall from from or just install from the old one then manually upgrade those packages and retest?

Comment 19 Bryan Kearney 2011-04-11 12:22:26 UTC
Pablo:

You should be able to use hte RHEL 6.1 beta. Subscription Manager is in there.

Comment 24 Pablo Iranzo Gómez 2011-04-12 15:50:24 UTC
Hi

After downloading the new iso and installing a system, I was able to perform the steps described in comment #17 and the system become compliant.

Doing yum upgrade on command line allowed me to check /etc/yum.repos.d/redhat.repo with the corresponding "proxy=" line for my proxy setup.

System was able to upgrade flawlesly and become compliant without any issue.

subscription-manager version tested: subscription-manager-0.95.6-1.el6.x86_64

Regards
Pablo

Comment 25 Pablo Iranzo Gómez 2011-04-12 15:51:28 UTC
snip of .repo file:


[rhel-lb-for-rhel-6-server-rpms]
name = Red Hat Enterprise Linux Load Balancer (for RHEL 6 Server) (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/loadbalancer/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/key.pem
sslclientcert = /etc/pki/entitlement/8543658780534923708.pem
proxy = http://192.168.122.1:8118

[rhel-lb-for-rhel-6-server-debug-rpms]
name = Red Hat Enterprise Linux Load Balancer (for RHEL 6 Server) (Debug RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/loadbalancer/debug
enabled = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/key.pem
sslclientcert = /etc/pki/entitlement/8543658780534923708.pem
proxy = http://192.168.122.1:8118

[rhel-rs-for-rhel-6-server-debug-rpms]
name = Red Hat Enterprise Linux Resilient Storage (for RHEL 6 Server) (Debug RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/resilientstorage/debug
enabled = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/key.pem
sslclientcert = /etc/pki/entitlement/8543658780534923708.pem
proxy = http://192.168.122.1:8118

[rhel-6-server-supplementary-src]
name = Red Hat Enterprise Linux 6 Server - Supplementary (Source RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/6Server/$basearch/supplementary/source/SRPMS
enabled = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/key.pem
sslclientcert = /etc/pki/entitlement/8543658780534923708.pem
metadata_expire = 86400
proxy = http://192.168.122.1:8118

Comment 26 John Sefler 2011-04-12 15:58:25 UTC
Moving bug to VERIFIED as a result of successful testing with Pablo reported in comment 24 and comment 25.

Comment 27 errata-xmlrpc 2011-05-19 13:39:50 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0611.html


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