Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howto:how_to_fix_yum_basic_auth_behind_a_proxy [2015/03/24 21:26] – created smark | howto:how_to_fix_yum_basic_auth_behind_a_proxy [2015/03/24 21:33] (current) – [Resolution] smark | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== How To Fix Yum Basic HTTP Authentication Behind a Proxy ====== | ====== How To Fix Yum Basic HTTP Authentication Behind a Proxy ====== | ||
- | ====== Problem | + | ===== Problem ===== |
When configuring a yum proxy via / | When configuring a yum proxy via / | ||
[root@myhost yum.repos.d]# | [root@myhost yum.repos.d]# | ||
Line 10: | Line 10: | ||
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel6-some-repo-x.y. Please verify its path and try again | Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel6-some-repo-x.y. Please verify its path and try again | ||
- | ====== Additional Information | + | ===== Additional Information ===== |
The customer used a cloud-based proxy service (ZScaler) but has NOT implemented proxy authentication. The proxy is configured correctly in / | The customer used a cloud-based proxy service (ZScaler) but has NOT implemented proxy authentication. The proxy is configured correctly in / | ||
- | ====== Troubleshooting | + | ===== Troubleshooting ===== |
A packet capture indicated the following HTTP header when requesting the repository information: | A packet capture indicated the following HTTP header when requesting the repository information: | ||
GET http:// | GET http:// | ||
- | Authorization: | + | Authorization: |
User-Agent: | User-Agent: | ||
Host: yum.whatever.com | Host: yum.whatever.com | ||
Accept: */* | Accept: */* | ||
Proxy-Connection: | Proxy-Connection: | ||
+ | |||
A GET HTTP request in this format is malformed and therefore return a "400 Bad request" | A GET HTTP request in this format is malformed and therefore return a "400 Bad request" | ||
+ | |||
Further investigation revealed Yum's documentation recommends the following configuration when implementing HTTP authentication for a yum repository: | Further investigation revealed Yum's documentation recommends the following configuration when implementing HTTP authentication for a yum repository: | ||
+ | |||
baseurl=http:// | baseurl=http:// | ||
username=REDACTED | username=REDACTED | ||
password=REDACTED | password=REDACTED | ||
+ | |||
Running the "yum check-update" | Running the "yum check-update" | ||
+ | |||
[root@myhost yum.repos.d]# | [root@myhost yum.repos.d]# | ||
Loaded plugins: priorities, refresh-packagekit, | Loaded plugins: priorities, refresh-packagekit, | ||
Line 33: | Line 38: | ||
Trying other mirror. | Trying other mirror. | ||
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel6-some-repo-x.y. Please verify its path and try again | Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel6-some-repo-x.y. Please verify its path and try again | ||
+ | |||
A packet capture shows the following HTTP request: | A packet capture shows the following HTTP request: | ||
+ | |||
GET http:// | GET http:// | ||
- | Authorization: | + | Authorization: |
User-Agent: | User-Agent: | ||
Host: yum.whatever.com | Host: yum.whatever.com | ||
Line 41: | Line 48: | ||
Proxy-Connection: | Proxy-Connection: | ||
Resolution: | Resolution: | ||
+ | |||
Because there is " | Because there is " | ||
+ | |||
The problem was tracked to an incompatibility with yum-3.2.29-60 and python-urlgrabber-3.9.1-9. | The problem was tracked to an incompatibility with yum-3.2.29-60 and python-urlgrabber-3.9.1-9. | ||
+ | |||
More information: | More information: | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | |||
This problem currently exists in RHEL 6.6 but may be resolved in a future version. It likely exists on any system with the python-urlgrabber-3.9.1-9 package. | This problem currently exists in RHEL 6.6 but may be resolved in a future version. It likely exists on any system with the python-urlgrabber-3.9.1-9 package. | ||
- | ====== Resolution | + | ===== Resolution ===== |
- | Modify / | + | |
- | Apply the patch as documented in the NEXUS URL. | + | 1. Modify / |
- | Copy the file urlgrabber.patch to the /root/ directory. | + | |
- | Back up the existing grabber.py file: | + | 2. Apply the patch as documented in the NEXUS URL: |
- | cp / | + | |
- | Patch the file: | + | 2a. Copy the file {{:howto:urlgrabber.patch|}} to the /root/ directory. |
- | patch / | + | |
- | Each command should return an output similar to below: | + | 2b. Back up the existing grabber.py file: |
- | patching file / | + | |
- | Hunk #2 succeeded at 426 (offset -5 lines). | + | cp / |
- | Hunk #3 succeeded at 828 (offset -6 lines). | + | |
- | Hunk #4 succeeded at 1253 (offset -9 lines). | + | 2c. Patch the file: |
- | Hunk #5 succeeded at 1349 (offset -9 lines). | + | |
- | Re-run the "yum check-update" | + | patch / |
+ | |||
+ | 2d. Each command should return an output similar to below: | ||
+ | |||
+ | patching file / | ||
+ | Hunk #2 succeeded at 426 (offset -5 lines). | ||
+ | Hunk #3 succeeded at 828 (offset -6 lines). | ||
+ | Hunk #4 succeeded at 1253 (offset -9 lines). | ||
+ | Hunk #5 succeeded at 1349 (offset -9 lines). | ||
+ | |||
+ | 3. Re-run the "yum check-update" |