apport-collect permission error on retrieving boot.log
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
plymouth (Ubuntu) |
Triaged
|
Medium
|
Unassigned | ||
xorg (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
RE: Bug Report: https:/
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@
-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/
...
Which means the 'root' is only user that can open or view them.
Examples:
...
mafoelffen@
awk: fatal: cannot open file `/var/log/boot.log' for reading: Permission denied
mafoelffen@
------------ 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
ProcVersionSign
Uname: Linux 6.2.0-33-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
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)
PackageArchitec
SourcePackage: apport
UpgradeStatus: Upgraded to jammy on 2022-08-17 (438 days ago)
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 apport/ package- hooks/source_ xorg.py: attach_ file_if_ exists( report, '/var/log/ boot.log' , 'BootLog') apport/ package- hooks/source_ xorg.py: report[ 'xserver. logfile' ] = xlog.boot_logfile apport/ package- hooks/source_ plymouth. py: attach_file(report, '/var/log/ boot.log' , 'BootLog')
/usr/share/
/usr/share/
/usr/share/
They use attach_file or attach_ file_if_ exists. They need to use root_command_output instead.