apport-collect permission error on retrieving boot.log

Bug #2041737 reported by Mike Ferreira
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
plymouth (Ubuntu)
Triaged
Medium
Unassigned
xorg (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

RE: Bug Report: https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/2041736

While reviewing this Bug Report, to add a comment to help explain something for this user, i noticed this error from apport collect:
...
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
...

This file is needed by Launchpad for diagnostics.

Just this week, I helped a Forum user review his boot.log files, so I am familiar with this. The permissions and ownership of the boot.log.X files are currently:
mafoelffen@Mikes-B460M:~$ ls -l /var/log/boot*
-rw------- 1 root root 0 Oct 16 00:00 /var/log/boot.log
-rw------- 1 root root 101106 Oct 16 00:00 /var/log/boot.log.1
-rw------- 1 root root 50432 Oct 14 00:00 /var/log/boot.log.2
-rw------- 1 root root 201696 Oct 12 00:00 /var/log/boot.log.3
-rw------- 1 root root 50375 Oct 10 00:00 /var/log/boot.log.4
-rw------- 1 root root 50497 Oct 9 00:00 /var/log/boot.log.5
-rw------- 1 root root 1598 Sep 29 00:00 /var/log/boot.log.6
-rw------- 1 root root 26496 Sep 28 19:10 /var/log/boot.log.7
-rw-r--r-- 1 root root 108494 Apr 19 2022 /var/log/bootstrap.log
...
Which means the 'root' is only user that can open or view them.

Examples:
...
mafoelffen@Mikes-ThinkPad-T520:~/Downloads$ awk 'NR>3{exit} {print $0}' /var/log/boot.log
awk: fatal: cannot open file `/var/log/boot.log' for reading: Permission denied

mafoelffen@Mikes-ThinkPad-T520:~/Downloads$ sudo awk 'NR>3{exit} {print $0}' /var/log/boot.log
------------ Sat Jul 22 00:27:04 PDT 2023 ------------
[ OK ] Started Show Plymouth Boot Screen.
[ OK ] Started Forward Password R…s to Plymouth Directory Watch.
...

That is why I think apport-collect is getting permissions errors and failing to retrieve the user boot.log for upload.

Expected behavior:
apport-collect should upload the boot.log successfully.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: apport 2.20.11-0ubuntu82.5
ProcVersionSignature: Ubuntu 6.2.0-33.33~22.04.1-generic 6.2.16
Uname: Linux 6.2.0-33-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: GNOME
Date: Sat Oct 28 20:44:58 2023
InstallationDate: Installed on 2021-09-23 (765 days ago)
InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819)
PackageArchitecture: all
SourcePackage: apport
UpgradeStatus: Upgraded to jammy on 2022-08-17 (438 days ago)

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

I have not found boot.log in the apport source code, but it is mentioned two package hooks:

grep boot.log /usr/share/apport/ -r
/usr/share/apport/package-hooks/source_xorg.py: attach_file_if_exists(report, '/var/log/boot.log', 'BootLog')
/usr/share/apport/package-hooks/source_xorg.py: report['xserver.logfile'] = xlog.boot_logfile
/usr/share/apport/package-hooks/source_plymouth.py: attach_file(report, '/var/log/boot.log', 'BootLog')

They use attach_file or attach_file_if_exists. They need to use root_command_output instead.

affects: apport (Ubuntu) → plymouth (Ubuntu)
Changed in plymouth (Ubuntu):
status: New → Triaged
Changed in xorg (Ubuntu):
status: New → Triaged
Changed in plymouth (Ubuntu):
importance: Undecided → Medium
Changed in xorg (Ubuntu):
importance: Undecided → Medium
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.