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

Bug#502318: apt: test for locked cache not quite right



Package: apt
Version: 0.7.16+b1
Severity: normal
File: /etc/cron.daily/apt

The /etc/cron.daily/apt job emailed me this error:

  /etc/cron.daily/apt:
  /etc/cron.daily/apt: could not lock the APT cache while performing daily cron job. 
  Is another package manager working?
  run-parts: /etc/cron.daily/apt exited with return code 1

which I tracked down to the following segment (line 205ff) from
the /etc/cron.daily/apt shell script:

  # check if we can access the cache
  if ! apt-get check -q -q 2>/dev/null; then
      # wait random amount of time before retrying
      random_sleep
      # check again
      if ! apt-get check -q -q 2>/dev/null; then
	  echo "$0: could not lock the APT cache while performing daily cron job. "
	  echo "Is another package manager working?"
	  exit 1
      fi
  fi

I had just done 'aptitude upgrade' and hpijs hadn't upgraded properly
because it needed to overwrite a file from hpijs-gui.  So 'apt-get
check' failed -- not because of any problem accessing the cache but
rather because of the hpijs problem.  

The preceding shell code from /etc/cron.daily/apt does not distinguish
between those failures, so it sleeps a random amount of time, fails
again for the same reason, (mistakenly) concludes that it cannot lock
the APT cache, and then exits with an error code.

I'm not sure of the right fix.

-- Package-specific info:

-- apt-config dump --

APT "";
APT::Architecture "i386";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "1";
APT::Install-Suggests "0";
APT::Acquire "";
APT::Acquire::Translation "environment";
APT::Authentication "";
APT::Authentication::TrustCDROM "true";
APT::NeverAutoRemove "";
APT::NeverAutoRemove:: "^linux-image.*";
APT::NeverAutoRemove:: "^linux-restricted-modules.*";
APT::Periodic "";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::userstatus "status.user";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::vendorlist "vendors.list";
Dir::Etc::vendorparts "vendors.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::dpkg "/usr/bin/dpkg";
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
DPkg "";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi";
DPkg::Pre-Install-Pkgs:: "/usr/bin/apt-listchanges --apt || test $? -ne 10";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
DPkg::Post-Invoke "";
DPkg::Post-Invoke:: "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi";
DPkg::Tools "";
DPkg::Tools::Options "";
DPkg::Tools::Options::/usr/bin/apt-listchanges "";
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
RPM "";
RPM::Pre-Install-Pkgs "";
RPM::Pre-Install-Pkgs:: "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi";
RPM::Post-Invoke "";
RPM::Post-Invoke:: "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi";

-- (no /etc/apt/preferences present) --


-- /etc/apt/sources.list --

# 
# deb cdrom:[Debian GNU/Linux 4.0 r2 _Etch_ - Official i386 NETINST Binary-1 20080103-00:44]/ etch contrib main

# deb http://ftp.us.debian.org/debian/ etch main non-free contrib
# deb-src http://ftp.us.debian.org/debian/ etch main non-free contrib

deb http://ftp.us.debian.org/debian/ unstable main non-free contrib
deb-src http://ftp.us.debian.org/debian/ unstable main non-free contrib

# deb http://security.debian.org/ etch/updates main contrib non-free
# deb-src http://security.debian.org/ etch/updates main contrib non-free

deb http://debathena.mit.edu/apt lenny debathena debathena-config debathena-system openafs
deb-src http://debathena.mit.edu/apt lenny debathena debathena-config debathena-system openafs

# 	deb http://people.debian.org/~preining/TeX/ tl2007/
# 	deb-src http://people.debian.org/~preining/TeX/ src/

#	deb http://www.backports.org/debian etch-backports main
#	deb-src http://www.backports.org/debian etch-backports main

#	deb http://people.debian.org/~preining/TeX/ lmodern/
#	deb-src http://people.debian.org/~preining/TeX/ lmodern/

#	deb http://people.debian.org/~preining/TeX/ context/
# 	deb-src http://people.debian.org/~preining/TeX/ context/

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages apt depends on:
ii  debian-archive-keyring   2008.04.16+nmu1 GnuPG archive keys of the Debian a
ii  libc6                    2.7-15          GNU C Library: Shared libraries
ii  libgcc1                  1:4.3.2-1       GCC support library
ii  libstdc++6               4.3.2-1         The GNU Standard C++ Library v3

apt recommends no packages.

Versions of packages apt suggests:
pn  apt-doc                      <none>      (no description available)
ii  aptitude                     0.4.11.10-1 terminal-based package manager
ii  bzip2                        1.0.5-1     high-quality block-sorting file co
ii  dpkg-dev                     1.14.22     Debian package development tools
ii  lzma                         4.43-14     Compression method of 7z format in
ii  synaptic                     0.62.1      Graphical package manager

-- no debconf information





Reply to: