Contents.gz files exist multiple times in sandboxes

Bug #1394798 reported by Brian Murray on 2014-11-20
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

ubuntu@juju-openstack-machine-11:~$ sudo find /srv/ -name trusty-Contents-amd64.gz
/srv/ 14.04/cache-sV4Gvl/cache/trusty-Contents-amd64.gz
/srv/ 14.04/cache-sV4Gvl/cache/Ubuntu 14.04/trusty-Contents-amd64.gz
/srv/ 14.04/cache-XRL5bo/cache/trusty-Contents-amd64.gz
/srv/ 14.04/cache-XRL5bo/cache/Ubuntu 14.04/trusty-Contents-amd64.gz
/srv/ 14.04/cache-Q4YgJm/cache/trusty-Contents-amd64.gz
/srv/ 14.04/cache-Q4YgJm/cache/Ubuntu 14.04/trusty-Contents-amd64.gz

and on a production retracer -

This is because needed_runtime_packages (in modifies cache_dir to include DistroRelease before calling get_file_package.

While make_sandbox (in does not add DistroRelease to cache_dir before calling get_file_package.

Subsequently, we have multiple copies of Contents-amd64.gz and for many runs of apport-retrace end up downloading the files twice as many times.

Related branches

Brian Murray (brian-murray) wrote :

Further evidence of the issue:

PYTHONPATH=$PYTHONPATH:~/source-trees/apport/trunk/ python ~/source-trees/apport/trunk/bin/apport-retrace -v -S /home/bdmurray/Documents/canonical/retracer-config --sandbox-dir /tmp/test-double-contents -C /tmp/test-double-contents /mnt/sec-machines/nautilus-libbz2-numbertwo.crash
Ign trusty InRelease
Hit trusty-proposed/multiverse amd64 Packages
Fetched 594 B in 6s (3531 kB/s)
Fetched 0 B in 0s (0 B/s)
Extracting downloaded debs...
needed_runtime_packages cache_dir: /tmp/test-double-contents/Ubuntu 14.04
WARNING: /lib/x86_64-linux-gnu/ is needed, but cannot be mapped to a package
WARNING: /usr/lib/x86_64-linux-gnu/ is needed, but cannot be mapped to a package
make_sandbox cache_dir: /tmp/test-double-contents
WARNING: Cannot find package which ships ExecutablePath
ERROR: ExecutablePath /tmp/test-double-contents/usr/bin/nautilus does not exist (report specified package nautilus 1:3.10.1-0ubuntu9.3)

Brian Murray (brian-murray) wrote :

This would fix the issue:

=== modified file 'apport/'
--- apport/ 2014-08-27 09:53:53 +0000
+++ apport/ 2014-11-21 00:07:25 +0000
@@ -195,7 +195,9 @@
     # crashing binary
     for path in ('InterpreterPath', 'ExecutablePath'):
         if path in report:
- pkg = apport.packaging.get_file_package(report[path], True, cache_dir,
+ if sandbox_dir:
+ new_cache_dir = os.path.join(cache_dir, report['DistroRelease'])
+ pkg = apport.packaging.get_file_package(report[path], True, new_cache_dir,
             if pkg:

Brian Murray (brian-murray) wrote :
Changed in apport:
status: New → Confirmed
Martin Pitt (pitti) wrote :

I fixed that in with a cleaner approach. It now always uses the same cache dir for simplicity.

Changed in apport:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers