apport:main

Last commit made on 2024-04-26
Get this branch:
git clone -b main https://git.launchpad.net/apport

Branch merges

Branch information

Name:
main
Repository:
lp:apport

Recent commits

adfe369... by Benjamin Drung

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.

Bug-Ubuntu: https://launchpad.net/bugs/2063349
Signed-off-by: Benjamin Drung <email address hidden>

04af911... by Benjamin Drung

test: fix test_missing_uid

`Report._get_ignore_dom()` calls `os.geteuid()` instead of
`os.getuid()`.

Fix `test_missing_uid` to mock `os.geteuid` instead of `os.getuid`, use
`MagicMock`, and check that the mock was called.

e856e0b... by Shivaram Lingamneni

remove dependency on python-requests

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`).

5f797ca... by Benjamin Drung

setup: determine udev directory dynamically

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>

3437342... by Benjamin Drung

report: fix determining bug report URL for Thunderbird

When running `ubuntu-bug thunderbird` on a system with the thunderbird
snap installed, it collects information correctly and opens a page like
https://bugs.launchpad.net/distros/+filebug/a9564134-dfa6-11ee-85a7-c7116d9f638e
which is not valid.

The snap contact information contains `distros` in the Launchpad URL:

```
$ snap info thunderbird | grep ^contact
contact: https://launchpad.net/distros/ubuntu/+source/thunderbird
```

Bug-Ubuntu: https://launchpad.net/bugs/2056758
Signed-off-by: Benjamin Drung <email address hidden>

3c6a27c... by Benjamin Drung

Release apport 2.28.1

Signed-off-by: Benjamin Drung <email address hidden>

a933aa8... by Benjamin Drung

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>

044ca83... by Benjamin Drung

chore: Update translation template

Signed-off-by: Benjamin Drung <email address hidden>

7e5a246... by Benjamin Drung

report: Ignore missing COREDUMP_FILENAME

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.

Bug: https://launchpad.net/bugs/2058380
Signed-off-by: Benjamin Drung <email address hidden>

43c4f2d... by Benjamin Drung

problem_report: Open file on CompressedFile initialization

Open the file on initialization of `CompressedFile` to ensure that the
compressed file can be read to avoid failing later.

Signed-off-by: Benjamin Drung <email address hidden>