Package: apt-cacher
Version: 1.5.4
Severity: normal
Tags: patch

Hello apt-cacher maintainers,

Since my /var/log/apt-cacher/access.log file got somehow corrupted,
I got the following error message:

Argument "MISS" isn't numeric in addition (+) at 
/usr/share/apt-cacher/apt-cacher-report.pl line 104.

The log file line causing this error was:
Fri Apr 20 05:26:59 2007|192.1Fri Apr 20 08:45:02 
2007|192.168.1.5|MISS|1845778|abiword-common_2.4.6-1.1_all.deb

A not so uncommon file corruption, possibly due to a full disk.

Simple workaround: check if the value is numeric before trying to add
it, see the simple patch attached.

regards,
Olaf

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18.3
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages apt-cacher depends on:
ii  bzip2                         1.0.3-6    high-quality block-sorting file co
ii  libwww-perl                   5.805-1    WWW client/server library for Perl
ii  perl                          5.8.8-7    Larry Wall's Practical Extraction 

apt-cacher recommends no packages.

-- no debconf information
--- /usr/share/apt-cacher/apt-cacher-report.pl.orig     2007-09-13 
21:33:59.000000000 +0200
+++ /usr/share/apt-cacher/apt-cacher-report.pl  2007-09-30 11:54:38.000000000 
+0200
@@ -84,9 +84,11 @@
        #$logfile_line =~ s/ /\+/g;
        @line = split /\|/, $logfile_line;
        $req_date = $line[0];
+
 #      $req_ip   = $line[1];
        $req_result = $line[2];
-       $req_bytes  = $line[3];
+       $req_bytes  = 0;
+       $req_bytes  = $line[3] if $line[3] =~ /^[0-9]+$/;
 #      $req_object = $line[4];
 
        $lastrecord = $req_date;

Reply via email to