[Yum] clean all traceback

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

 



--=-ot9pI1ePVVjzjsNkYlzU
Content-Type: multipart/mixed; boundary="=-Ir2DaLZ3mgIyY9foGzwd"


--=-Ir2DaLZ3mgIyY9foGzwd
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Wed, 2003-01-15 at 16:00, Troy Dawson wrote:
> Howdy Ho,
> Here at fermilab we have this odd little problem that only happens twice =
then=20
> goes away.  It happens in our nightly cron job, as it cleans itself up.
>=20
> So, here is the senario.
> A user does a fresh install, or for some other reason, put's yum on for t=
he=20
> first time, and get's their headers seeded.  To do that we basically have=
 all=20
> the headers from the repository, and the header.info file, in a tar ball,=
 we=20
> then put them in the appropriate spot.  But this means that they now have=
 all=20
> the headers, so running a yum clean is going to remove a bunch of them.
> So along comes the nightly yum, and we have it clean itself up as it goes=
=20
> along.  But as it is cleaning up, we get the traceback below.
> We've actually been having this happen for a long time, but, it only happ=
ens=20
> on the first, and occasionally the second, time that this cleanup happens=
.  So=20
> the user get's the e-mail one night, and they are worried, so they check =
to=20
> see if yum is still working, which it is, then they forget about it.
>=20
> --snip---from running it with a -d4 instead of -d2---snip--
>=20
> Deleting Header /var/cache/yum/731updates/headers/kernel-0-2.4.18-10.i386=
.hdr
> Deleting Header /var/cache/yum/731updates/headers/kernel-0-2.4.18-10.i586=
.hdr
> Deleting Header /var/cache/yum/731updates/headers/kernel-0-2.4.18-10.i686=
.hdr
> Deleting Header /var/cache/yum/731updates/headers/kernel-0-2.4.18-10.i686=
.hdr
> Traceback (innermost last):
>    File "/usr/sbin/yum", line 24, in ?
>      yummain.main(sys.argv[1:])
>    File "yummain.py", line 181, in main
>    File "clientStuff.py", line 687, in take_action
>    File "clientStuff.py", line 530, in clean_up_old_headers
> OSError: [Errno 2] No such file or directory:=20
> '/var/cache/yum/731updates/headers/kernel-0-2.4.18-10.i686.hdr'
>=20
> --end-snip---end-snip---end-snip--
>=20
> I wasn't too worried about it until the farm people said they were going =
to be=20
> upgrading 500 nodes next month to be using yum.  Also the users are start=
ing=20
> to go to our release that uses it, and the observant users are noticing a=
nd=20
> asking about it more and more.
>=20
> I do have the full output of doing the command with a -d 4 and a -d 10, a=
s=20
> well as the config file and full command that causes the traceback.  I fi=
gured=20
> I'd spare the list and only send it to those that want it.
>=20

oo look - I found it :-D

clientStuff.py - starting at line 516 it says:

    for hdrfn in hdrlist:
        hdr =3D readHeader(hdrfn)
        (e, n, v, r, a) =3D getENVRA(hdr)
        if rpmDBInfo.exists(n, a):
            (e1, v1, r1) =3D rpmDBInfo.evr(n, a)
            rc =3D compareEVR((e1, v1, r1), (e, v, r))
            # if the rpmdb has an equal or better rpm then delete
            # the header
            if (rc >=3D 0):
                log(4, 'Deleting Header %s' % hdrfn)
                os.unlink(hdrfn)
        if not HeaderInfo.exists(n, a):
            # if its not in the HeaderInfo nevral anymore just kill it
            log(4, 'Deleting Header %s' % hdrfn)
            os.unlink(hdrfn)

well if the hdr isn't needed b/c there is a good enough one in the rpmdb
AND it's no longer in the header.info anywhere well, then it's being
deleted twice.

apply this patch see if you see it anymore. If it works then It'll go
in.
thanks
-sv



--=-Ir2DaLZ3mgIyY9foGzwd
Content-Disposition: attachment; filename=oldheaderdel.patch
Content-Type: text/plain; name=oldheaderdel.patch; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

--- clientStuff.py	9 Dec 2002 05:37:31 -0000	1.47
+++ clientStuff.py	15 Jan 2003 21:50:20 -0000
@@ -514,6 +514,7 @@
         hdrdir =3D conf.serverhdrdir[serverid]
         hdrlist =3D getfilelist(hdrdir, '.hdr', hdrlist)
     for hdrfn in hdrlist:
+        todel =3D 0
         hdr =3D readHeader(hdrfn)
         (e, n, v, r, a) =3D getENVRA(hdr)
         if rpmDBInfo.exists(n, a):
@@ -522,13 +523,14 @@
             # if the rpmdb has an equal or better rpm then delete
             # the header
             if (rc >=3D 0):
-                log(4, 'Deleting Header %s' % hdrfn)
-                os.unlink(hdrfn)
+                todel =3D todel + 1
+                log(6, 'Header %s should be deleted' % hdrfn)
         if not HeaderInfo.exists(n, a):
             # if its not in the HeaderInfo nevral anymore just kill it
-            log(4, 'Deleting Header %s' % hdrfn)
+            todel =3D todel + 1
+            log(6, 'Deleting Header %s' % hdrfn)
+        if todel > 0:
             os.unlink(hdrfn)
-           =20
=20
 def printtime():
     import time

--=-Ir2DaLZ3mgIyY9foGzwd--

--=-ot9pI1ePVVjzjsNkYlzU
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA+JdgT1Aj3x2mIbMcRApoDAJ96OAt+kTS7bNCZ024lLPTy/KBIjgCgkSRX
T/WtSogqwLIahXYTZBZYsqQ=
=9p8U
-----END PGP SIGNATURE-----

--=-ot9pI1ePVVjzjsNkYlzU--



[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux