Bug 447271

Summary: yum dies when using an http config url
Product: Red Hat Enterprise Linux 5 Reporter: Issue Tracker <tao>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.2CC: james.brown, jhutar, tao
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 21:43:48 UTC Type: ---
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: 391501, 447398    

Description Issue Tracker 2008-05-19 08:20:28 UTC
Escalated to Bugzilla from IssueTracker

Comment 1 Issue Tracker 2008-05-19 08:20:31 UTC
Description of problem:

Any yum commands using "-c http://server/yumconfigfile" fails with ENOENT error.

How reproducible:

100%

Steps to Reproduce:

Create a valid yum config url.  Use it like this:

yum -c http://server/yumconfigfile search foobar

(or any yum subcommand).

Actual results:

Loading "security" plugin
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 85, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
    disabled_plugins=self.optparser._splitArg(opts.disableplugins))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 164, in _getConfig
    self._conf = config.readMainConfig(startupconf)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 703, in readMainConfig
    yumconf.config_file_age = os.stat(startupconf.config_file_path)[8]
OSError: [Errno 2] No such file or directory: 'http://server/yumconfigfile'

Expected results:

Proper yum execution of subcommands

Additional info:
==========================================
-bash-3.2# rpm -qi redhat-release
Name        : redhat-release               Relocations: (not relocatable)
Version     : 5Server                           Vendor: Red Hat, Inc.
Release     : 5.2.0.3                       Build Date: Mon 14 Jan 2008 04:26:42 PM UTC
Install Date: Fri 16 May 2008 04:22:42 PM UTC      Build Host: ls20-bc1-14.build.redhat.com
Group       : System Environment/Base       Source RPM: redhat-release-5Server-5.2.0.3.src.rpm
Size        : 150160                           License: GPL
Signature   : DSA/SHA1, Thu 17 Jan 2008 11:08:35 PM UTC, Key ID fd372689897da07a
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary     : Red Hat Enterprise Linux release file
Description :
Red Hat Enterprise Linux release files
==========================================

I have also verified that yum is treating the http url as a regular unix file.  That is, it's stat'ing it, and it will actually open and use a file at the relative path http://server/yumconfigfile within the unix filesystem.
This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 180836

Comment 2 Issue Tracker 2008-05-19 08:20:32 UTC
John, I had a few spare cycles over the weekend and duplicated this. Looks
like this was broken in the rebase somewhere between 3.0.1-5 available in
RHEL5.1 and 3.2.8-4 in RHEL5.2beta. I don't see an existing BZ on this
and am sending it up to engineering straight away. 

- James


Category set to: Applications::Bug Fix
Status set to: Waiting on Tech

This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 180836

Comment 3 Issue Tracker 2008-05-19 08:20:34 UTC
1. Provide time and date of the problem: N/A

   2. Provide clear and concise problem description as it is understood at
the time of escalation
          * Observed behavior: yum -c http://server/yum.conf produces the
following traceback.
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 85, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
    disabled_plugins=self.optparser._splitArg(opts.disableplugins))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 164, in
_getConfig
    self._conf = config.readMainConfig(startupconf)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 703, in
readMainConfig
    yumconf.config_file_age = os.stat(startupconf.config_file_path)[8]
OSError: [Errno 2] No such file or directory:
'http://erin.usersys.redhat.com/yum.conf'

          * Desired behavior: yum -c http://server/yum.conf should work 

   3. State specific action requested of SEG:
Identify where this is broken and patch

   4. State whether or not a defect in the product is suspected
          * Provide Bugzilla if one already exists: No known BZ

   1. State other actions already taken in working the problem:
          Searched all resources and unable to find an existing bug or
workaround.

   3. Attach other supporting data
Found in yum-3.2.8-7.el5.noarch.rpm (5.2 beta channel). Note that this
works in yum-3.0.1-5.el5.noarch.rpm (RHEL 5.1 channel).

   4. Provide issue repro information:
         Simply mv /etc/yum.conf to a server running a http and try
running with -c argument, "yum -c http://erin.usersys.redhat.com/yum.conf
update"

You can use erin.usersys.redhat.com for quick verification.

- James


Issue escalated to Support Engineering Group by: jabrown.
Internal Status set to 'Waiting on SEG'

This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 180836

Comment 4 Issue Tracker 2008-05-19 08:20:35 UTC
This may be of some help
https://lists.dulug.duke.edu/pipermail/yum-cvs-commits/2007-July/001801.html


This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 180836

Comment 5 RHEL Program Management 2008-05-19 08:36:37 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.

Comment 6 James Antill 2008-05-19 12:58:23 UTC
 This fixes it for me (config.py):

-    yumconf.config_file_age = os.stat(startupconf.config_file_path)[8]
+    if os.path.exists(startupconf.config_file_path):
+        yumconf.config_file_age = os.stat(startupconf.config_file_path)[8]
+    else:
+        yumconf.config_file_age = 0

...I'm just not sure what we do at this point in the 5.2 release, esp. as we are
going to do a big update for 5.3.


Comment 29 errata-xmlrpc 2009-01-20 21:43:48 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/RHBA-2009-0176.html