Bug 236478 - Pup handles network outages badly
Pup handles network outages badly
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: pirut (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
:
Depends On:
Blocks: FC7Blocker
  Show dependency treegraph
 
Reported: 2007-04-14 17:50 EDT by Jens Knutson
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-30 16:53:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jens Knutson 2007-04-14 17:50:46 EDT
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 yumRepo.py:593:setup:RepoError: Cannot open/read repomd.xml
file for repository: extras-development

Traceback (most recent call last):
  File "/usr/sbin/pup", line 647, in <module>
    main()
  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/__init__.py", line 120, in __init__
    plugin_types=(yum.plugins.TYPE_CORE,))
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 103, in
doConfigSetup
    errorlevel=errorlevel)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 158, in _getConfig
    self.plugins.run('init')
  File "/usr/lib/python2.5/site-packages/yum/plugins.py", line 162, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/dellsysidplugin.py", line 40, in init_hook
    repos = conduit.getRepos()
  File "/usr/lib/python2.5/site-packages/yum/plugins.py", line 426, in getRepos
    return self._base.repos
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 493, in <lambda>
    repos = property(fget=lambda self: self._getRepos(),
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 335, in _getRepos
    repo.setup(self.conf.cache, self.mediagrabber)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", 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):
1.3.6-1

How reproducible:
100%

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 11:59:53 EDT
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 13:03:01 EDT
   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 13:15:55 EDT
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('*'):
        repo.yumvar.update(conf.yumvar)

    # re-process mirrorlist (it isnt varReplaced like baseUrl is)
    for repo in repos.findRepos('*'):
        try:
            # yum 3.0+
            if repo.mirrorlist:
                for (key, value) in conf.yumvar.items():
                    repo.mirrorlist = repo.mirrorlist.replace("$%s" % key, value)
        except AttributeError:
            pass
    
        try:
            # yum 2.4.3
            if repo.mirrorlistfn:
                for (key, value) in conf.yumvar.items():
                    repo.mirrorlistfn = repo.mirrorlistfn.replace("$%s" % key,
value)
        except AttributeError:
            pass
Comment 4 Jeremy Katz 2007-04-30 16:53:02 EDT
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.