race in lock checking code

Bug #437709 reported by João Pinto
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
aptdaemon (Ubuntu)
Fix Released
Medium
Michael Vogt
software-center (Ubuntu)
Fix Released
High
Zygmunt Krynicki

Bug Description

Binary package hint: software-center

If there is another apt operation running (was doing sudo apt-get install mysql-server from a terminal window), the ubuntu software center will report an unknown error because of the failed lock:

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/aptdaemon/worker.py", line 91, in _process_transaction
    self.install_packages(**self.trans.kwargs)
  File "/usr/lib/python2.6/dist-packages/aptdaemon/worker.py", line 157, in install_packages
    self._commit_changes()
  File "/usr/lib/python2.6/dist-packages/aptdaemon/worker.py", line 398, in _commit_changes
    end=install_range[1]))
  File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 311, in commit
    res = self._fetchArchives(fetcher, pm)
  File "/usr/lib/python2.6/dist-packages/apt/cache.py", line 234, in _fetchArchives
    raise LockFailedException("Failed to lock %s" % lockfile)
LockFailedException: Failed to lock /var/cache/apt/archives/lock

ProblemType: Bug
Architecture: amd64
Date: Sun Sep 27 17:31:39 2009
DistroRelease: Ubuntu 9.10
Package: software-center 0.4.0
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-11.36-generic
SourcePackage: software-center
Uname: Linux 2.6.31-11-generic x86_64

Revision history for this message
João Pinto (joaopinto) wrote :
Christoph Korn (c-korn)
summary: - "An uknown error" is reported when apt-daemon fails to acquire the apt
+ "An unknown error" is reported when apt-daemon fails to acquire the apt
lock
Revision history for this message
Christoph Korn (c-korn) wrote : Re: "An unknown error" is reported when apt-daemon fails to acquire the apt lock

I can confirm this error.

Seems to be some kind of race condition.

This is how I reproduced it:
1. apt-get install wine (I have chosen this because pulling the library packages should take some time)
2. Open the Ubuntu Software Store and choose to install some application (I took amule). It should be queued in the list telling that it is waiting for another process to finish (apt-get).
3. When the download of the packages for the wine installation has finished the error occured in Ubuntu Software Store.
4. At the same time dpkg failed in the terminal (the wine installation) with:
dpkg: Status database section is locked by another process. (Translated from german).

Michael Vogt (mvo)
Changed in software-center (Ubuntu):
status: New → Triaged
importance: Undecided → High
Michael Vogt (mvo)
summary: - "An unknown error" is reported when apt-daemon fails to acquire the apt
- lock
+ race in lock checking code
Changed in aptdaemon (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aptdaemon - 0.10+bzr242-0ubuntu1

---------------
aptdaemon (0.10+bzr242-0ubuntu1) karmic; urgency=low

  * aptdaemon/core.py:
    - do not fail on a not running syslog daemon (LP: #428843)
  * Include dpkg errors in the error output
  * debian/rules:
    - move to simple-patchsys (for now) to make maintaining the
      patches simpler
  * debian/patches/disallow-unauthenticated-branch.diff:
    Patch generated from lp:~mvo/aptdaemon/allow-unauthenticated
    to support controlling if unauthenticated packages are allowed
    during a transaction. Default to "not allow unauthenticated"
    (LP: #435313)
  * debian/patches/mvo-branch.patch:
    Patch generated from lp:~mvo/aptdaemon/mvo that fixes:
    - aptdaemon/worker.py: check the apt download dir lock
      in _watch_lock to avoid possible race with apt-get LP: #437709
    - aptdaemon/progress.py: fix crash in error handling (LP: #436808)
    - aptdaemon/progress.py: fix crash in INSTALL_TIMEOUT handling
      (LP: #430860)
    - aptdaemon/gtkwidgets.py: make the dialog resizable and add bigger
      default size (LP: #434937)
    - aptdaemon/core.py: add _remove_from_connection_no_raise() that
      will discard errors if the object is not exported (LP: #422585)

 -- Michael Vogt <email address hidden> Mon, 28 Sep 2009 09:39:34 +0200

Changed in aptdaemon (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Michael Vogt (mvo) wrote :

This should be fixed with the aptdaemon upload. I set it to fix released, please reopen if someone can reproduce it again.

Changed in software-center (Ubuntu):
status: Triaged → Fix Released
Changed in aptdaemon (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
Michael Vogt (mvo)
Changed in software-center (Ubuntu):
assignee: nobody → Zygmunt Krynicki (zkrynicki)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.