Apport does not collect all logs when the package is HWE kernel

Bug #2018128 reported by lotuspsychje
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Triaged
Medium
Unassigned
linux (Ubuntu)
Invalid
Undecided
Juerg Haefliger

Bug Description

Ubuntu 22.04 LTS with kernel 5.19.0-41-generic

When filing bugs against the package 'linux' apport collects all the logs needed
to the kernel

But in case the user is not on stock kernel anymore and has the HWE kernel
apport only imports 2 logs Dependencies.txt + ProcCpuInfoMinimal.txt

and forwards the package 'linux' towards linux-signed-hwe-5.19 (in my case)

would it be possible to make apport collect all the logs needed in all kernel cases?

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: apport 2.20.11-0ubuntu82.4
ProcVersionSignature: Ubuntu 5.19.0-41.42~22.04.1-generic 5.19.17
Uname: Linux 5.19.0-41-generic x86_64
ApportLog:

ApportVersion: 2.20.11-0ubuntu82.4
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Sat Apr 29 05:25:30 2023
PackageArchitecture: all
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
lotuspsychje (lotuspsychje) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apport (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote :

The apport package hooks are actually shipped by the individual packages so this is something for the for the maintainers of the kernel package to address.

affects: apport (Ubuntu) → linux (Ubuntu)
Juerg Haefliger (juergh)
Changed in linux (Ubuntu):
assignee: nobody → Juerg Haefliger (juergh)
Revision history for this message
Benjamin Drung (bdrung) wrote :

The kernel package has an exception. The apport package ships the source_linux.py hooks and several symlinks:

```
$ ls -l /usr/share/apport/package-hooks/source_linux*
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-firmware.py -> source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-meta-oem-osp1.py -> source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-meta-oem.py -> source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-meta.py -> source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-meta-raspi.py -> source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-oem-osp1.py -> source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-oem.py -> source_linux.py
-rw-r--r-- 1 root root 6523 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-signed-oem-osp1.py -> source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-signed-oem.py -> source_linux.py
lrwxrwxrwx 1 root root 15 Apr 14 00:17 /usr/share/apport/package-hooks/source_linux-signed.py -> source_linux.py
```

How is the HWE kernel package named? Can you try to add a symlink for the source package name to see if that solves your issue?

Changed in apport (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
lotuspsychje (lotuspsychje) wrote :

@4 Benjamin

i ran sudo ln -s source_linux.py /usr/share/apport/package-hooks/source_linux-signed-hwe.py

and added a symlink /usr/share/apport/package-hooks/source_linux-signed-hwe.py -> source_linux.py

then created a new bug against 'linux' but the results were the same, no logs were imported

see the new bug report https://bugs.launchpad.net/ubuntu/+source/linux-signed-hwe-5.19/+bug/2020268

Juerg Haefliger (juergh)
Changed in linux (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Benjamin Drung (bdrung) wrote :

Can you test with including the version number in the link name?

/usr/share/apport/package-hooks/source_linux-signed-hwe-5.19.py -> source_linux.py

Revision history for this message
Juerg Haefliger (juergh) wrote :

This needs some rework. Kernel source package names change a lot and with every release so static symlinks will not work. We might have to query LP to get up-to-date kernel source information.

Revision history for this message
Juerg Haefliger (juergh) wrote :

Or the kernel package itself needs to provide the symlink.

Revision history for this message
Benjamin Drung (bdrung) wrote :

The source_linux.py package hook could be moved to general-hooks (where it is always run) and do a regular expression check for the source package name.

Revision history for this message
Juerg Haefliger (juergh) wrote :

I don't think we can do this with a regex. There are linux-<foo> package that are not kernels.

Revision history for this message
Juerg Haefliger (juergh) wrote :

List of kernel source packages as of 2023/10/23.

Revision history for this message
Juerg Haefliger (juergh) wrote :

Maybe it doesn't matter if the kernel hook is triggered for those since they never get bug reports anyways :-)

Revision history for this message
Juerg Haefliger (juergh) wrote :

Maybe something like this?
https://git.launchpad.net/~juergh/+git/apport/log/?h=juergh/ubuntu/devel

Move and rename source_linux.py to general-hooks/zz-kernel.pi, ensure it runs last (because it wants properties that are set by other general hooks) and only for kernel and related (firmware and dkms) packages.

Revision history for this message
Benjamin Drung (bdrung) wrote :

I discussed this topic with Simon and we came up with a less fragile solution:

Each kernel binary package can ship a symlink to /usr/share/apport/package-hooks/source_linux.py. Example: linux-image-5.19.0-50-generic should ship /usr/share/apport/package-hooks/linux-image-5.19.0-50-generic.py -> source_linux.py

This will work without a regular expression that will break sooner or later.

Revision history for this message
Juerg Haefliger (juergh) wrote :

I don't think that is sufficient for all possible source, meta and binary kernel package incarnations. I need to do some testing.

Revision history for this message
lotuspsychje (lotuspsychje) wrote :

I'm currently testing Ubuntu desktop 24.04 development branch with kernel 6.5.0-10-generic

After filing a bug against the kernel; ubuntu-bug linux i'm getting a GUI warning
the package is wrong and results onto this error:

cloud-init run data not found on system. Unable to add cloud-specific data.

Revision history for this message
lotuspsychje (lotuspsychje) wrote :

On Ubuntu-desktop 24.04 development branch @ 15/4/2024

filing a bug against 'linux' now gives these warnings in terminal:

REDACTED config part /etc/cloud/cloud.cfg.d/99-installer.cfg, insufficient permissions
REDACTED config part /etc/cloud/cloud.cfg.d/90-installer-network.cfg, insufficient permissions

apport still continues gathering system info and launching browser correctly

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.