sosreport is broken

Bug #1774464 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
New
High
Canonical Server
sosreport (Ubuntu)
New
Undecided
Ubuntu on IBM Power Systems Bug Triage

Bug Description

sosreport seems to be broken in the area of capturing /var/log files. I am seeing symlinks create for essential log files like "kernel.log" and "syslog" for which the target files are not getting included. For example:

$ ls -l sosreport/var/log/
total 124
-rw-r-----+ 1 guest guest 114 Feb 2 18:07 apport.log
-rw-r-----+ 1 guest guest 878 Jan 1 22:08 apport.log.1
drwxr-x---+ 2 guest guest 4096 Jan 1 06:25 apt
drwxr-x---+ 2 guest guest 4096 Jan 31 06:25 cups
-rw-r-----+ 1 guest guest 2846 Feb 2 11:29 dpkg.log
drwxr-x---+ 3 guest guest 4096 Dec 20 11:34 installer
lrwxrwxrwx. 1 guest guest 46 Feb 6 08:39 kern.log -> ../../sos_strings/logs/var.log.kern.log.tailed
lrwxrwxrwx. 1 guest guest 48 Feb 6 08:39 kern.log.1 -> ../../sos_strings/logs/var.log.kern.log.1.tailed
drwxr-x---+ 3 guest guest 4096 Dec 20 15:51 libvirt
drwxr-x---+ 2 guest guest 4096 Feb 5 13:21 lxd
lrwxrwxrwx. 1 guest guest 44 Feb 6 08:39 syslog -> ../../sos_strings/logs/var.log.syslog.tailed
-rw-r-----+ 1 guest guest 48223 Jan 31 06:25 syslog.1
drwxr-x---+ 2 guest guest 4096 Dec 20 11:45 unattended-upgrades
$ ls sosreport/
date free java lsof ps sos_logs usr
dev hostname last lspci pstree sos_reports var
df initctl lib mount route sys version.txt
dmidecode installed-debs lsb-release netstat run uname vgdisplay
etc ip_addr lsmod proc sos_commands uptime
$

It appears to be some attempt to shorten logs, although that itself is disconcerting. Unclear what options were used to run sosreport.

====
My hunch is that the "--log-size" option is being used, either automatically or manually, but that option is failing to include the "sos_strings" subdirectory in the archive.

== ==
I have confirmed that this issue still exists. On Ubuntu 18.04 I and another distro, I ran the following command:

sosreport --log-size=1

I then copied the sosreport off to another system and unpacked it. In the case of the other distro sosreport, the var/log/messages files was a symlink but was readable (existed). However, in the case of Ubuntu the var/log/syslog file was a broken symlink "syslog -> ../../sos_strings/logs/var.log.syslog.tailed", and no "sos_strings" directory existed, and thus the data was lost.

sosreport 3.5-1ubuntu3 (Ubuntu 18.04)

vs.

sos-3.5-6.el7.noarch (other distro)

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-164312 severity-high targetmilestone-inin1804
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → sosreport (Ubuntu)
bugproxy (bugproxy)
tags: removed: bugnameltc-164312 severity-high
Frank Heimes (fheimes)
tags: added: bugnameltc-164312 severity-high
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
importance: Undecided → High
assignee: nobody → Canonical Server Team (canonical-server)
tags: added: triage-g
Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Error output:
# cat sos_logs/logs-plugin-errors.txt
Traceback (most recent call last):
  File "/usr/share/sosreport/sos/sosreport.py", line 1300, in collect
    plug.collect()
  File "/usr/share/sosreport/sos/plugins/__init__.py", line 877, in collect
    self._collect_strings()
  File "/usr/share/sosreport/sos/plugins/__init__.py", line 860, in _collect_strings
    (content.splitlines()[0]).decode('utf8', 'ignore'))
AttributeError: 'str' object has no attribute 'decode'

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

This is being fixed as part of 1761442.

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.