Contents.gz files exist multiple times in sandboxes

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

Bug Description

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

and on a production retracer - https://pastebin.canonical.com/120850/

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

While make_sandbox (in sandboxutils.py) 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 http://192.168.10.1 trusty InRelease
....
Hit http://ddebs.ubuntu.com 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/libdbus-1.so.3.7.6 is needed, but cannot be mapped to a package
WARNING: /usr/lib/x86_64-linux-gnu/libexempi.so.3.2.3 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/sandboxutils.py'
--- apport/sandboxutils.py 2014-08-27 09:53:53 +0000
+++ apport/sandboxutils.py 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,
                                                     release=report['DistroRelease'],
                                                     arch=report.get('Architecture'))
             if pkg:

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

I fixed that in http://bazaar.launchpad.net/~apport-hackers/apport/trunk/revision/2874 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