← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~brian-murray/apport/fix-pkg-cache-traceback into lp:apport

 

Brian Murray has proposed merging lp:~brian-murray/apport/fix-pkg-cache-traceback into lp:apport.

Requested reviews:
  Apport upstream developers (apport-hackers)

For more details, see:
https://code.launchpad.net/~brian-murray/apport/fix-pkg-cache-traceback/+merge/273761

I ran into the following Traceback when manually retracing the apport crash file attached to bug 1503034.

Installing extra package autofs to get ExecutablePath
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 194, in __getitem__
    return self._weakref[key]
  File "/usr/lib/python3.4/weakref.py", line 125, in __getitem__
    o = self.data[key]()
KeyError: 'libgmp10-dbgsym'
   
During handling of the above exception, another exception occurred:
   
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 198, in __getitem__
    rawpkg = self._cache[key]
KeyError: 'libgmp10-dbgsym'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bdmurray/source-trees/apport/trunk/bin/apport-retrace", line 301, in <module>
    options.dynamic_origins)
  File "/home/bdmurray/source-trees/apport/trunk/apport/sandboxutils.py", line 228, in make_sandbox
    architecture=report.get('Architecture'), origins=origins)
  File "/home/bdmurray/source-trees/apport/trunk/apport/packaging_impl.py", line 991, in install_packages
    cache[p].mark_install(False, False)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 200, in __getitem__
    raise KeyError('The cache has no package named %r' % key)
KeyError: "The cache has no package named 'libgmp10-dbgsym'"

This is because the libgmp10-dbgsym amd64 package doesn't exist on ddebs.ubuntu.com but does exist in Launchpad. If the package does not exist in the apt-cache then we should not add it to real_pkgs. This fixes that.  This error is also occurring on the Error Tracker retracers.
-- 
Your team Apport upstream developers is requested to review the proposed merge of lp:~brian-murray/apport/fix-pkg-cache-traceback into lp:apport.
=== modified file 'backends/packaging-apt-dpkg.py'
--- backends/packaging-apt-dpkg.py	2015-09-29 21:34:03 +0000
+++ backends/packaging-apt-dpkg.py	2015-10-07 22:18:23 +0000
@@ -971,7 +971,6 @@
                                 (lp_url, sha1sum) = self.get_lp_binary_package(self.get_distro_name(),
                                                                                dbgsym_pkg, ver, architecture)
                                 if lp_url:
-                                    real_pkgs.add(dbgsym_pkg)
                                     acquire_queue.append(apt.apt_pkg.AcquireFile(fetcher,
                                                                                  lp_url,
                                                                                  hash="sha1:%s" % sha1sum,