Re: SMART error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 8 Jun 2007 16:39:40 -0700
stan <stanl@xxxxxxx> wrote:

> On Fri, 8 Jun 2007 17:57:41 -0400
> Claude Jones <claude_jones@xxxxxxxxxxxxxx> wrote:
> 
> > Just did a SMART update, and it found lots of packages - I 
> > usually update frequently, but, I may have let this machine 
> > slide. After a lengthy download process, it just returned an 
> > error dialog:
> > 
> > *******************************************************
> > Traceback (most recent call last):
> > 
> >   
> > File
> > "/usr/lib/python2.4/site-packages/smart/interfaces/gtk/interactive.py",
> > line 171, in callback exec code in globals
> > 
> >   File "<callback>", line 1, in ?
> > 
> >   
> > File
> > "/usr/lib/python2.4/site-packages/smart/interfaces/gtk/interactive.py",
> > line 457, in upgradeAll self.applyChanges(confirm=not
> > emptychangeset)
> > 
> >   
> > File
> > "/usr/lib/python2.4/site-packages/smart/interfaces/gtk/interactive.py",
> > line 415, in applyChanges if
> > self._ctrl.commitTransaction(transaction, confirm=confirm):
> > 
> >   File "/usr/lib/python2.4/site-packages/smart/control.py", line 
> > 505, in commitTransaction
> >     return self.commitChangeSet(trans.getChangeSet(), caching, 
> > confirm)
> > 
> >   File "/usr/lib/python2.4/site-packages/smart/control.py", line 
> > 563, in commitChangeSet
> >     pmclass().commit(pmcs, pkgpaths)
> > 
> >   
> > File "/usr/lib/python2.4/site-packages/smart/backends/rpm/pm.py", 
> > line 165, in commit
> >     loader = [x for x in pkg.loaders if x.getInstalled()][0]
> > 
> > IndexError: list index out of range
> > *******************************************************
> > 
> > Anyone spot anything? Don't seem to get many responses on the 
> > smart list, so I thought I'd try here first
> 
> If you're willing to change things a little, you might be able to find
> out more about the problem.
> 
> In the file 
> /usr/lib/python2.4/site-packages/smart/backends/rpm/pm.py
> (on fc7 it is python2.5 instead of python2.5)
> add the following lines around the culprit that is failing.
> 
> try:
>  loader = [x for x in pkg.loaders if not x.getInstalled()][0]
> except:
>  print ("loaders index failure %s \n %s" % (str(pkg),
> str(pkg.loaders)))
> 
> Make sure the indentation is consistent, important in python.
> This will slow it down slightly, but when it bombs will print the
> stringification of the pkg and pkg.loaders.  It is actually
> pkg.loaders that is a container and has no objects.  If smart runs
> from the gui, this will probably print in logs somewhere or on a
> console.  If from the command line, it should print right below the
> command output.
> 
Realized that if your not familiar with python I should give you a
little more context for the code change.

        for pkg, op in sorted:
            if op is INSTALL:
                if pkg.installed:
                    reinstall = True
		try:
                  loader = [x for x in pkg.loaders if not
x.getInstalled()][0] 
		except:
		  print ("pkg.loaders index failure %s \n %s" %
(str(pkg), str(pkg.loaders)))
		info = loader.getInfo(pkg)
                mode = pkg in upgrading and "u" or "i"
                path = pkgpaths[pkg][0]
                fd = os.open(path, os.O_RDONLY)
                try:
                    h = ts.hdrFromFdno(fd)
                except rpm.error, e:
                    os.close(fd)
                    raise Error, "%s: %s" % (os.path.basename(path), e)
                os.close(fd)
                ts.addInstall(h, (info, path), mode)
                packages += 1


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux