apt_dpkg: discard cached contents mapping on OSError#593
Open
bdrung wants to merge 1 commit intocanonical:mainfrom
Open
apt_dpkg: discard cached contents mapping on OSError#593bdrung wants to merge 1 commit intocanonical:mainfrom
bdrung wants to merge 1 commit intocanonical:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #593 +/- ##
==========================================
+ Coverage 84.45% 84.47% +0.02%
==========================================
Files 104 104
Lines 20939 20967 +28
Branches 3212 3216 +4
==========================================
+ Hits 17683 17711 +28
- Misses 2815 2816 +1
+ Partials 441 440 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9f689b8 to
18f5f37
Compare
test_retrace_jammy_sandbox might fail in a autopkgtest VM:
```
Traceback (most recent call last):
File "/usr/bin/apport-retrace", line 713, in <module>
sys.exit(main(sys.argv[1:]))
~~~~^^^^^^^^^^^^^^
File "/usr/bin/apport-retrace", line 542, in main
sandbox, cache, outdated_msg = apport.sandboxutils.make_sandbox(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
report,
^^^^^^^
...<6 lines>...
options.dynamic_origins,
^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/python3/dist-packages/apport/sandboxutils.py", line 274, in make_sandbox
pkgs = needed_runtime_packages(report, pkgmap_cache_dir, pkg_versions, verbose)
File "/usr/lib/python3/dist-packages/apport/sandboxutils.py", line 103, in needed_runtime_packages
pkg = packaging.get_file_package(
line,
...<3 lines>...
arch=report.get("Architecture"),
)
File "/usr/lib/python3/dist-packages/apport/packaging_impl/apt_dpkg.py", line 800, in get_file_package
return self._search_contents(file, map_cachedir, release, arch)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/apport/packaging_impl/apt_dpkg.py", line 1752, in _search_contents
contents_mapping = self._get_file2pkg_mapping(map_cachedir, release, arch)
File "/usr/lib/python3/dist-packages/apport/packaging_impl/apt_dpkg.py", line 1726, in _get_file2pkg_mapping
file2pkg = self._contents_mapping(map_cachedir, release, arch)
File "/usr/lib/python3/dist-packages/apport/packaging_impl/apt_dpkg.py", line 340, in _contents_mapping
self._contents_mapping_obj = pickle.load(fp)
~~~~~~~~~~~^^^^
EOFError: Ran out of input
```
Discard the cache in those cases and just rebuild them.
Bug: https://launchpad.net/bugs/2149911
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_retrace_jammy_sandbox might fail in a autopkgtest VM:
Discard the cache in those cases and just rebuild them.
Bug: https://launchpad.net/bugs/2149911