apport: Ignore container crash reports from systemd-coredump
systemd-coredump stores crashes that happen inside a container on the
host in case it cannot forward the crash to the container. Apport cannot
do anything useful with these crash reports, because the information
about the crashed process does not contain the process number seen from
inside the container and because the crashed process is already gone
when Apport gets the crash from systemd-coredump.
So let Apport just ignore crash reports from systemd-coredump if the
crashes happened inside containers.
Importing `requests` uses about 10 MB of additional memory and costs
about 100 milliseconds. My personal motivation is more to push backwards
against the increasing size and complexity of the Ubuntu base system, or
alternatively, to reduce the number of projects that constitute critical
infrastructure for Linux.
`urllib.request` raises an exception for anything other than a 20x
by default (this is `urllib.request.HTTPErrorHandler`).
On /usr merged systems like Ubuntu 24.04 the udev rules are placed into
`/usr/lib/udev/rules.d` instead of `/lib/udev/rules.d`.
Determine the location of the udev directory from the pkg-config file
and fallback to the old location on failure. Install `pkg-config` in the
`system-installed` test.
Signed-off-by: Benjamin Drung <email address hidden>
feat: Import translation updates from Ubuntu 24.04 (noble)
Import translation updates from https://translations.launchpad.net/ubuntu/noble/+source/apport for
languages that have updates. Do not update translations that have no
changes except for updated metadata (POT-Creation-Date,
X-Launchpad-Export-Date, and X-Generator). Do not import languages that
have zero translated messages.
Signed-off-by: Benjamin Drung <email address hidden>
If a systemd-coredump report points to a coredump file that does not
exist (any more), Apport will fail:
```
Traceback (most recent call last):
File "/usr/share/apport/apport", line 1244, in <module>
sys.exit(main(sys.argv[1:])) ^^^^^^^^^^^^^^^^^^
File "/usr/share/apport/apport", line 761, in main
return process_crash_from_systemd_coredump(options.systemd_coredump_instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/apport/apport", line 1240, in process_crash_from_systemd_coredump
return process_crash(report, real_user, report_owner) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/apport/apport", line 1146, in process_crash
info.write(reportfile)
File "/usr/lib/python3/dist-packages/problem_report.py", line 548, in write
self._write_binary_item_compressed_and_encoded(file, k)
File "/usr/lib/python3/dist-packages/problem_report.py", line 722, in _write_binary_item_compressed_and_encoded
self._write_binary_item_base64_encoded(
File "/usr/lib/python3/dist-packages/problem_report.py", line 629, in _write_binary_item_base64_encoded
for chunk in chunks:
File "/usr/lib/python3/dist-packages/problem_report.py", line 649, in _generate_compressed_chunks
yield from value.iter_compressed()
File "/usr/lib/python3/dist-packages/problem_report.py", line 194, in iter_compressed
with open(self.filename, "rb") as compressed_file: ^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/systemd/coredump/core.tracker-extract.1000.92c6d53b71364e3286fd6011f3dad5e7.4441.1710845299000000.zst'
```
Ignore the missing coredump file and print a warning for it.