'not a debian format' package install failures should be Unreportable

Bug #1002535 reported by Brian Murray
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Brian Murray
Fix Released
Brian Murray

Bug Description

In bug 1001715 we can see a package installation failure with the message:

 dpkg-deb: error: `/var/cache/apt/archives/openjdk-7-jre-lib_7~u3-2.1.1~pre1-1ubuntu2_all.deb' is not a debian format archive

These should not be reportable as they are indicative a corrupt or faulty package. I've committed a fix for this to apport for Quantal:


However, only 24 of these have been reported so far:


so an SRU may not be worth the work. In the event the we decide it is Steve Langasek came up with the following for recreating the error with a good package:


set -e

for i in "$@"
    case $i in
            cp /bin/bash $i

exec /usr/bin/dpkg.real "$@"

SRU REGRESSION POTENTIAL: Very low, the new condition is very specific on the error message in dpkg.log. It could potentially prevent real bugs from being reported if a package file "a.deb" is damaged, but you are trying to install a package "b.deb" in the same run which fails for some other reason. That seems to be a corner case, though, and on a system which managed to corrupt .deb files we do not have a lot of faith in any more anyway.

- Move dpkg aside: sudo mv /usr/bin/dpkg{,.real}
- Replace /usr/bin/dpkg with the wrapper from above, and make it executable
- Try to install a package, e. g. "sudo apt-get install pmount"
- Confirm that it fails with "is not a debian format archive"
- Apport should pop up; try to report the bug
- It will succeed in the precise version, but will abort with "cannot be reported" with this fix.
- After that, don't forget to restore dpkg: sudo mv /usr/bin/dpkg{.real,}

Changed in apport (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
Changed in apport (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Martin Pitt (pitti) wrote :

Uploaded precise SRU to unapproved.

Changed in apport (Ubuntu Precise):
status: Triaged → Fix Committed
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi! this bug needs a test case and regression potential before we can accept it into precise-proposed. Thanks!

Martin Pitt (pitti)
description: updated
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted apport into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

I'm still actively investigating this but I was unable to verify the fix for this bug in Precise and also tested it in Quantal and still received a crash report for the package that failed to install.

Here's the relevant bit of code that was added to apport to block these:

       if attachment in report and re.search(r'dpkg-deb: error.*is not a debian format archive', report[attachment], re.MULTILINE):
            report['UnreportableReason'] = 'This failure was caused by a corrupted package download or file system corruption.'

Which still looks correct to me.

tags: added: verification-failed
removed: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

I was testing in a chroot and thought that the creation of /var/crash/2vcard.0.crash was an indication that the filter was not working. This is not infact the case as dpkg / apt writes the crash file and then apport processes it when it notices the crash file or you run apport-cli /var/crash/2vcard.0.crash. Having run that in the chroot with the proposed version of apport I received the following:

*** Problem in 2vcard

The problem cannot be reported:

This failure was caused by a corrupted package download or file system corruption.

Which is what we want - changing the tag to verification-done.

tags: added: verification-done
removed: verification-failed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.0.1-0ubuntu11

apport (2.0.1-0ubuntu11) precise-proposed; urgency=low

  * data/package-hooks/source_linux.py: If we report against an -lts-quantal
    source package, move the source to "linux" and add a qa-kernel-lts-testing
    tag, as per kernel team request in LP: #1004101 . Add source package hook
    symlinks for source_linux-{,meta-}lts-quantal.py to source_linux.py.
  * data/apport: apport: Also treat a binary as modified if the /proc/pid/exe
    symlink does not point to an existing file any more. Backported from trunk
    r2406. (LP: #984944)

apport (2.0.1-0ubuntu10) precise-proposed; urgency=low

  * debian/apport.install: Actually ship the native-origins.d directory, so
    that the previous bug fix for LP: #1004101 actually works.

apport (2.0.1-0ubuntu9) precise-proposed; urgency=low

  [ Martin Pitt ]
  * data/apport: Ignore a crash if the executable was modified after the
    process started. This often happens if the package is upgraded and a
    long-running process is not stopped before. Patch cherry-picked from trunk
    r2296. (LP: #984944)
  * Add etc/apport/native-origins.d/lts-q-backports: Accept
    ppa:ubuntu-x-swat/q-lts-backport as official Ubuntu package repository, so
    that users can report bugs and crashes against the backported kernel and
    X.org stack. (LP: #1004101)
  * data/general-hooks/ubuntu.py: Do not assume that all reports have a
    ProblemType field. This will not be the case for updating a bug with
    "apport-collect". (LP: #1004029)
  * report.py: Do not change the SourcePackage: field if the binary package is
    not installed and does not exist. This fixes source package hooks to
    actually work in some cases where source and binary package names overlap.
    Patch cherry-picked from trunk r2332. (part of LP: #993810)
  * apport-gtk, apport-kde: Avoid collecting information twice in "bug update"
    mode. This caused a crash in cases where the source package in a bug
    report does not correspond to an installed binary package. Patch
    cherry-picked from trunk r2334. (LP: #993810)

  [ Brian Murray ]
  * data/general-hooks/ubuntu.py: block reporting of package install failures
    with error regarding 'not a debian format archive'. (LP: #1002535)
 -- Martin Pitt <email address hidden> Thu, 28 Jun 2012 09:01:41 +0200

Changed in apport (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers