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

diagnosis apt-get update problems



I'm trying to diagnose some problems that appear when I do an aptitude
update or apt-get update.  I believe the ultimate cause is not with
apt, but I'm trying to work backwards.  It may be the problems are
exposing some weaknesses in apt's handling of corner cases.

I'd appreciate help in debugging, though of course solutions would be
nice too!  Please cc me on the replies.

SYMPTOMS

apt-get update will not complete happily.  It alternates between two
types of failures.

1. 
W: GPG error: http://debian.betterworld.us testing Release: The following signatures were invalid: BADSIG 010908312D230C5F Debian Archive
+Automatic Signing Key (2006) <ftpmaster@debian.org>

The program does complete and exit in this case.

2. The update reports errors with bzip2 and never exits.  I need to ^C
from the terminal or kill batch jobs.  Here's part of the log from
#apt-get -o Debug::Acquire::Http=true -o Acquire::http::Pipeline-Depth=0 -s update -o  APT::Status-Fd=2 
------------------------------------------------------------
bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

Err http://debian.betterworld.us unstable/main Packages
  Sub-process bzip2 returned an error code (2)

# later
Err http://debian.betterworld.us unstable/contrib Packages
  Could not open file /var/lib/apt/lists/partial/debian.betterworld.us:3142_ftp.us.debian.org_debian_dists_unstable_contrib_binary-i386_Packages - open (2 No such file or directory)
dlstatus:71:99.3674:Retrieving file 71 of 80
99% [Working]
bzip2: I/O or other error, bailing out.  Possible reason follows.
bzip2: Resource temporarily unavailable
        Input file = (stdin), output file = (stdout)
dlstatus:71:99.3674:Retrieving file 71 of 80
9
--------------------------------------------------------
The last line repeated until I killed the job.
Sometimes the error concerns testing.  for example, another run
without the debugging options produced
------------------------------------------------------
97% [30 Packages bzip2 0]                                                                                                                     108B/s 17m27s
bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

Err http://debian.betterworld.us testing/main Packages
  Sub-process bzip2 returned an error code (2)
# ......
Err http://debian.betterworld.us testing/contrib Packages
  Could not open file /var/lib/apt/lists/partial/debian.betterworld.us:3142_ftp.us.debian.org_debian_dists_testing_contrib_binary-i386_Packages - open (2 No such file or directory)
99% [Working]
bzip2: I/O or other error, bailing out.  Possible reason follows.
bzip2: Resource temporarily unavailable
        Input file = (stdin), output file = (stdout)
99% [Working]
-------------------------------
hanging at that point.

I get these errors in successive runs at the same time.  For awhile,
each attempt would alternate between 1 and 2, but now 2 seems
predominant.


APT ISSUES WITH THE SYMPTOMS

Obviously it would be nice if the program didn't hang indefinitely.

It's hard to tell, even with debugging, exactly which files are
attempts are causing the trouble.  In particular, with the message
dlstatus:71:99.3674:Retrieving file 71 of 80
I don't know what file 71 is.  It is greater than the count of items
displayedon the terminal for gets.

The -s option seems ineffective with update.

QUESTIONS

The parallelism makes the problems hard to diagnose.  Is there a way
of disabling it?  My use of Acquire::http::Pipeline-Depth=0 was an
effort to do so, but doesn't seem to have worked.  (Similarly,
apt-cacher's parallelism makes its logs hard to follow.)

How do I find out what file 71 is?

The bz2 file does not seem to be saved permanently by apt, making
diagnosis especially tricky.  Is there anything I can do about that?

How do I do build and use a debug version of the package?  Is doing so
advisable, or should I stick to setting command-line options to enable
debugging or tracing?

BACKGROUND PROBLEMS

I'm using apt-cacher, which seems to promote such misbehavior.  I
think it has problems coping with some error conditions, and I've had
a lot.  The references to debian.betterworld.us are to my own system,
with apt-cacher servicing requests.

I've been manually deleting files from apt and apt-cacher's areas
(both caches and /var/lib/apt) in an effort to fix things.  This may
have made them worse.  I also tried apt-get clean.

I've verified that some of the bz2 files apt-cache's cache are bad,
though I've deleted them and the replacements seem OK.

I used the berkeley mirror, and it disappeared completely.

I switched to the sluglug.ucsc.edu mirror, and found that its .deb
files were out of date with respect to the indices (i.e., when my
system attempted to retrieve the deb from the packages directory, the
deb wasn't there).

I switched to the ftp.us.debian.org mirror, making 3 mirror switches.

/var/cache/apt may have filled up (it's a bit hard to tell if it
actually filled or if I was getting errors because of the sluglug.ucsc
problems).  It was certainly close to full.

VERSION INFO
Running a mostly testing Debian system (Athlon chip).
$ uname -a
Linux wheat 2.4.27advncdfs #1 Thu Oct 20 23:44:40 PDT 2005 i686 GNU/Linux

apt                   0.6.45
apt-cacher            1.5.3 (yes, I realize this is not your responsibility)

I have downloaded the source for apt and looked at some of the
internals documentation.

Thanks.
Ross Boylan



Reply to: