Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 236478 - Pup handles network outages badly
Summary: Pup handles network outages badly
Alias: None
Product: Fedora
Classification: Fedora
Component: pirut
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
Depends On:
Blocks: FC7Blocker
TreeView+ depends on / blocked
Reported: 2007-04-14 21:50 UTC by Jens Knutson
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-04-30 20:53:02 UTC

Attachments (Terms of Use)

Description Jens Knutson 2007-04-14 21:50:46 UTC
Description of problem:

Pup's handling of network unavailability is poor.  When trying to run updates
today, I didn't realize my network cable was unplugged, and Pup gave me the
following error when I tried running it:

Component: Software Updater
Summary: TB429a3a99 Cannot open/read repomd.xml
file for repository: extras-development

Traceback (most recent call last):
  File "/usr/sbin/pup", line 647, in <module>
  File "/usr/sbin/pup", line 640, in main
    pup = PackageUpdater(not options.autoapply)
  File "/usr/sbin/pup", line 88, in __init__
    GraphicalYumBase.__init__(self, False)
  File "/usr/lib/python2.5/site-packages/pirut/", line 120, in __init__
  File "/usr/lib/python2.5/site-packages/yum/", line 103, in
  File "/usr/lib/python2.5/site-packages/yum/", line 158, in _getConfig'init')
  File "/usr/lib/python2.5/site-packages/yum/", line 162, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/", line 40, in init_hook
    repos = conduit.getRepos()
  File "/usr/lib/python2.5/site-packages/yum/", line 426, in getRepos
    return self._base.repos
  File "/usr/lib/python2.5/site-packages/yum/", line 493, in <lambda>
    repos = property(fget=lambda self: self._getRepos(),
  File "/usr/lib/python2.5/site-packages/yum/", line 335, in _getRepos
    repo.setup(self.conf.cache, self.mediagrabber)
  File "/usr/lib/python2.5/site-packages/yum/", line 593, in setup
    raise Errors.RepoError, ('Cannot open/read repomd.xml file for repository:
%s' % self)
RepoError: Cannot open/read repomd.xml file for repository: extras-development

Local variables in innermost frame:
self: extras-development
cache: 0
e: failure: repodata/repomd.xml from extras-development: [Errno 256] No more
mirrors to try.
mediafunc: None

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Disconnect from the network
2.Run pup

Actual results:

Get user-worthless error message

Expected results:

A user-useful error message saying, "Your network connection appears to be
offline - updates cannot be made while offline" or some such.

Additional info:

This is just a cheerleader aside, but it seems like Pirut and Pup get a lot of
mud slung at them, so I wanted to say that the UNBELIEVABLE speed increases and
actually-updating-UI in the recent pirut releases have been awesome.  You guys
rock!  :)

Comment 1 Jeremy Katz 2007-04-16 15:59:53 UTC
Hrmm... it looks like this is because the dellsysid plugin does repo
initialization really early and without any explicit request for the setup.

Michael -- is there a reason that the plugin has to set up repos in its init
hook?  I'd look, but CVS seems down at the moment.

Comment 2 Michael E Brown 2007-04-16 17:03:01 UTC
   I have asked for a 'yumvar' hook. This would vastly simplify my plugin, and
eliminate the need for 'getRepos()'.

   With the current yum design, I *must* do this loop in order to update the
cached copy of 'yumvars' that is held in each repo. I also must manually fixup
the mirrorlist because my plugin runs too late.

   This all goes away if I get a 'yumvars' plugin hook, as described on the
mailing list.

Comment 3 Michael E Brown 2007-04-16 17:15:55 UTC
If you can suggest an alternate way, I would be happy to also change the current
code. Current code does this:

    repos = conduit.getRepos()
    for repo in repos.findRepos('*'):

    # re-process mirrorlist (it isnt varReplaced like baseUrl is)
    for repo in repos.findRepos('*'):
            # yum 3.0+
            if repo.mirrorlist:
                for (key, value) in conf.yumvar.items():
                    repo.mirrorlist = repo.mirrorlist.replace("$%s" % key, value)
        except AttributeError:
            # yum 2.4.3
            if repo.mirrorlistfn:
                for (key, value) in conf.yumvar.items():
                    repo.mirrorlistfn = repo.mirrorlistfn.replace("$%s" % key,
        except AttributeError:

Comment 4 Jeremy Katz 2007-04-30 20:53:02 UTC
Added a hook for the plugin which should let the plugin do its setup differently
and thus not set up repos before expected.

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