sosreport: AttributeError: 'str' object has no attribute 'decode'

Bug #1761442 reported by bugproxy on 2018-04-05
26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
High
Canonical Server Team
sosreport
Fix Released
Unknown
sosreport (Ubuntu)
Status tracked in Cosmic
Trusty
High
Dan Streetman
Xenial
High
Dan Streetman
Artful
High
Dan Streetman
Bionic
High
Dan Streetman
Cosmic
High
Dan Streetman

Bug Description

[impact]

sosreport plugin(s) fail

[test case]

run sosreport, then extract the captured report and check the sos_logs/logs-plugin-errors.txt file for output like:

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'

one of the ways to trigger this is for sosreport to gather a file that is larger than its max size to gather, for example log files over its --log-size limit. To reproduce this way, first make sure one or more of the sosreport-gathered log files are over 1m, e.g. on a newly-installed system (where log files are small) you could do this just to generate logs:

# udevadm control -l 7
# for n in $( seq 1 50 ) ; do udevadm trigger ; done

after that, /var/log/syslog should be larger than 1m. Then run sosreport and limit its log file size to 1m:

# sosreport --log-size 1

The resulting sosreport will contain the error while trying to gather the syslog.

[regression potential]

the currently failing plugins fail to gather any of their data, so there is not much regression for them, but this change has the potential to affect any plugin and prevent data gathering.

[other info]

original description below.
---

---Problem Description---
sosreport: ubuntu 16.04.04: AttributeError: 'str' object has no attribute 'decode'

---uname output---
Linux guest 4.15.0-13-generic #14~16.04.1-Ubuntu SMP Sat Mar 17 03:03:53 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux

Machine Type = boston-LC

---Debugger---
A debugger is not configured

---Steps to Reproduce---
 running sosreport throws below error. report collection succeeds. this bug is to fix below:

root@guest:~/sosreport-guest-20180405020015/sos_logs# cat 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'

root@guest:~/sosreport-guest-20180405020015/sos_logs# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
root@guest:~/sosreport-guest-20180405020015/sos_logs# dpkg -l | grep -i sos
ii sosreport 3.5-1~ubuntu16.04.2 ppc64el Set of tools to gather troubleshooting data from a system

== Comment: #5 - SEETEENA THOUFEEK <email address hidden> - 2018-04-05 04:53:10 ==
identified this commit will fix the issue.

https://github.com/sosreport/sos/commit/1fd12690870e85e8ac83b0e99bb272ce4489dc60

bugproxy (bugproxy) on 2018-04-05
tags: added: architecture-ppc64le bugnameltc-166458 severity-low targetmilestone-inin---
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → sosreport (Ubuntu)
Frank Heimes (frank-heimes) wrote :

affecting ppc64el, but not limited to it

Changed in ubuntu-power-systems:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Canonical Server Team (canonical-server)
tags: added: triage-g
Manoj Iyer (manjo) on 2018-04-09
Changed in ubuntu-power-systems:
importance: Low → High
Changed in sosreport (Ubuntu):
importance: Undecided → High
assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → David Britton (davidpbritton)
Changed in sosreport (Ubuntu):
assignee: David Britton (davidpbritton) → Dan Streetman (ddstreet)
Dan Streetman (ddstreet) wrote :

> identified this commit will fix the issue.
>
> https://github.com/sosreport/sos/commit/1fd12690870e85e8ac83b0e99bb272ce4489dc60

that commit is already included in the sosreport version being used, so it does not seem it will fix this.

Dan Streetman (ddstreet) wrote :

<email address hidden> I can't reproduce this on x86, does this happen on all ppc64le systems or only on specific system(s) you have? Can you provide the sosreport generated with that error?

Changed in sosreport (Ubuntu):
status: New → Incomplete
Dan Streetman (ddstreet) wrote :

I did find an existing sosreport I have that includes this error; I'll look at the code to see what's going on.

Changed in sosreport (Ubuntu):
status: Incomplete → In Progress
Dan Streetman (ddstreet) wrote :

Opened github sosreport issue 1266 for this
https://github.com/sosreport/sos/issues/1266

Also opened pull request 1267 to fix
https://github.com/sosreport/sos/pull/1267

Dan Streetman (ddstreet) wrote :

<email address hidden> I built a test sosreport package for Xenial in this ppa:
https://launchpad.net/~ddstreet/+archive/ubuntu/lp1761442

can you install that sosreport and retest to verify it fixes the error? If you need a test pkg for trusty or artful (or bionic) let me know and I can build in the ppa for those releases as well.

Changed in sosreport:
status: Unknown → New

------- Comment From <email address hidden> 2018-04-17 01:06 EDT-------
Srikanth, Can you verify per above

Changed in ubuntu-power-systems:
status: Triaged → Incomplete
Changed in sosreport (Ubuntu):
status: In Progress → Incomplete
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-05-16 23:48 EDT-------
Tested with ppa given, issue seems to be resolved.

root@ubuntu1604:~# dpkg -l | grep sos
ii sosreport 3.5-1~ubuntu16.04.2+hf1761442v20180410b2 ppc64el Set of tools to gather troubleshooting data from a system
root@ubuntu1604:~#
root@ubuntu1604:~# sosreport

sosreport (version 3.5)

This command will collect system configuration and diagnostic
information from this Ubuntu system. An archive containing the collected
information will be generated in /tmp/sos.1phinvqn.

For more information on Ubuntu visit:

http://www.ubuntu.com/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.

Press ENTER to continue, or CTRL-C to quit.

Please enter your first initial and last name [ubuntu1604]:
Please enter the case id that you are generating this report for []:

Setting up archive ...
Setting up plugins ...
Running plugins. Please wait ...

Running 54/54: xfs...
Creating compressed archive...

Your sosreport has been generated and saved in:
/tmp/sosreport-ubuntu1604-20180516224800.tar.xz

The checksum is: ac03578061d23267f34f5b47d7d20a7a

Please send this file to your support representative.

bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-05-16 23:50 EDT-------
However I see new issue with

root@ubuntu1604:~# sudo add-apt-repository ppa:ddstreet/lp1761442
More info: https://launchpad.net/~ddstreet/+archive/ubuntu/lp1761442
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp5_zskxu2/secring.gpg' created
gpg: keyring `/tmp/tmp5_zskxu2/pubring.gpg' created
gpg: requesting key 52D2BD8D from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp5_zskxu2/trustdb.gpg: trustdb created
gpg: key 52D2BD8D: public key "Launchpad PPA for Dan Streetman" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
root@ubuntu1604:~#
root@ubuntu1604:~# sudo add-apt-repository ppa:ddstreet/lp1761442
Segmentation fault
^^^^
[ 392.031762] add-apt-reposit[4571]: unhandled signal 11 at c0000000000086d8 nip 00003fff90f52a58 lr 00003fff90eda4dc code 30001
`

Observing this in every alternate run of add-apt-repository run
dmesg has `

Dan Streetman (ddstreet) wrote :

> Tested with ppa given, issue seems to be resolved.

thanks, the upstream patch has been ack'ed by 2 of the maintainers and should be merged soon. It will make its way into SRU releases after that.

> root@ubuntu1604:~# sudo add-apt-repository ppa:ddstreet/lp1761442
> Segmentation fault

certainly a completely different problem from this. It doesn't happen on my amd64 system, I wonder if it's a PPC issue, or if there's some problem with your specific install. If you continue to have that problem on multiple systems you should open a new bug.

Changed in sosreport (Ubuntu):
status: Incomplete → In Progress
Eric Desrochers (slashd) wrote :

Quick update about the upstream PR from sosreport maintainer :

"fix is in the review queue, should land next week with any luck.

We're planning to make a 3.5.1 interim release shortly to help distro packagers who cannot wait until 3.6 final is out - this fix will be included in that tag."

We will start the process for Debian & Ubuntu once officially release upstream.

bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-05-22 05:53 EDT-------
Canonical provided fix for this issue.

https://bugzilla.linux.ibm.com/show_bug.cgi?id=166458#c13

test sosreport package for Xenial in this ppa:
https://launchpad.net/~ddstreet/+archive/ubuntu/lp1761442

Srikanth tested it and resolve the issue.

https://bugzilla.linux.ibm.com/show_bug.cgi?id=166458#c16

Srikanth , if you see new issue with on multiple systems

root@ubuntu1604:~# sudo add-apt-repository ppa:ddstreet/lp1761442
> Segmentation fault

please open new bug. Thanks.

Changed in ubuntu-power-systems:
status: Incomplete → In Progress
Dan Streetman (ddstreet) wrote :

upstream has commited the fix, this will be included in the next sosreport SRU.

Dan Streetman (ddstreet) wrote :
Changed in sosreport (Ubuntu Bionic):
assignee: nobody → Dan Streetman (ddstreet)
Changed in sosreport (Ubuntu Artful):
assignee: nobody → Dan Streetman (ddstreet)
Changed in sosreport (Ubuntu Xenial):
assignee: nobody → Dan Streetman (ddstreet)
Changed in sosreport (Ubuntu Trusty):
assignee: nobody → Dan Streetman (ddstreet)
status: New → In Progress
Changed in sosreport (Ubuntu Xenial):
status: New → In Progress
Changed in sosreport (Ubuntu Artful):
status: New → In Progress
Changed in sosreport (Ubuntu Bionic):
status: New → In Progress
Dan Streetman (ddstreet) on 2018-06-05
Changed in sosreport (Ubuntu Trusty):
importance: Undecided → High
Changed in sosreport (Ubuntu Xenial):
importance: Undecided → High
Changed in sosreport (Ubuntu Bionic):
importance: Undecided → High
Changed in sosreport (Ubuntu Artful):
importance: Undecided → High
Eric Desrochers (slashd) wrote :

Sponsored for Cosmic.

Please go ahead with the SRU once Cosmic is "Fix Released".
Have a look at the excuses page if you suspect the package is stuck in -proposed.

tags: added: patch
Eric Desrochers (slashd) on 2018-06-05
Changed in sosreport (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 3.5-1ubuntu4

---------------
sosreport (3.5-1ubuntu4) cosmic; urgency=medium

  * d/p/Fix-string-decoding-for-debug-log-output.patch:
    Fix bug in _collect_strings that causes error trying to str.decode()
    (LP: #1761442)

 -- Dan Streetman <email address hidden> Tue, 05 Jun 2018 10:52:56 -0400

Changed in sosreport (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Dan Streetman (ddstreet) on 2018-06-06
description: updated

Hello bugproxy, or anyone else affected,

Accepted sosreport into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.5-1ubuntu3.18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in sosreport (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Łukasz Zemczak (sil2100) wrote :

Hello bugproxy, or anyone else affected,

Accepted sosreport into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.5-1~ubuntu17.10.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in sosreport (Ubuntu Artful):
status: In Progress → Fix Committed
tags: added: verification-needed-artful
Changed in sosreport (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed-xenial
Łukasz Zemczak (sil2100) wrote :

Hello bugproxy, or anyone else affected,

Accepted sosreport into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.5-1~ubuntu16.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in sosreport (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed-trusty
Łukasz Zemczak (sil2100) wrote :

Hello bugproxy, or anyone else affected,

Accepted sosreport into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/3.5-1~ubuntu14.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-trusty to verification-done-trusty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-trusty. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Dan Streetman (ddstreet) on 2018-06-08
description: updated
Dan Streetman (ddstreet) wrote :

cosmic:

root@lp1761442-c:/tmp# grep sosreport sosreport-lp1761442-c.1234-20180608171415/installed-debs
ii sosreport 3.5-1ubuntu3 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-c:/tmp# cat sosreport-lp1761442-c.1234-20180608171415/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'
root@lp1761442-c:/tmp# ls -l sosreport-lp1761442-c.1234-20180608171415/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:14 sosreport-lp1761442-c.1234-20180608171415/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-c:/tmp# ls -l sosreport-lp1761442-c.1234-20180608171415/sos_strings/logs/var.log.syslog.tailed
ls: cannot access 'sosreport-lp1761442-c.1234-20180608171415/sos_strings/logs/var.log.syslog.tailed': No such file or directory

root@lp1761442-c:/tmp# grep sosreport sosreport-lp1761442-c.1234-20180608172234/installed-debs
ii sosreport 3.5-1ubuntu4 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-c:/tmp# ls -l sosreport-lp1761442-c.1234-20180608172234/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:22 sosreport-lp1761442-c.1234-20180608172234/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-c:/tmp# ls -l sosreport-lp1761442-c.1234-20180608172234/sos_strings/logs/var.log.syslog.tailed
-rw-r--r-- 1 root root 1048576 Jun 8 17:22 sosreport-lp1761442-c.1234-20180608172234/sos_strings/logs/var.log.syslog.tailed

Dan Streetman (ddstreet) wrote :

b:

root@lp1761442-b:/tmp# grep sosreport sosreport-lp1761442-b.1234-20180608172937/installed-debs
ii sosreport 3.5-1ubuntu3 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-b:/tmp# cat sosreport-lp1761442-b.1234-20180608172937/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'

root@lp1761442-b:/tmp# ls -l sosreport-lp1761442-b.1234-20180608172937/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:29 sosreport-lp1761442-b.1234-20180608172937/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-b:/tmp# ls -l sosreport-lp1761442-b.1234-20180608172937/sos_strings/logs/*
ls: cannot access 'sosreport-lp1761442-b.1234-20180608172937/sos_strings/logs/*': No such file or directory

root@lp1761442-b:/tmp# grep sosreport sosreport-lp1761442-b.1234-20180608173903/installed-debs
ii sosreport 3.5-1ubuntu3.18.04.1 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-b:/tmp# ls -l sosreport-lp1761442-b.1234-20180608173903/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:39 sosreport-lp1761442-b.1234-20180608173903/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-b:/tmp# ls -l sosreport-lp1761442-b.1234-20180608173903/sos_strings/logs/var.log.syslog.tailed
-rw-r--r-- 1 root root 1048576 Jun 8 17:39 sosreport-lp1761442-b.1234-20180608173903/sos_strings/logs/var.log.syslog.tailed

Dan Streetman (ddstreet) wrote :

a:

root@lp1761442-a:/tmp# grep sosreport sosreport-lp1761442-a.1234-20180608171327/installed-debs
ii sosreport 3.5-1~ubuntu17.10.2 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-a:/tmp# cat sosreport-lp1761442-a.1234-20180608171327/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'

root@lp1761442-a:/tmp# ls -l sosreport-lp1761442-a.1234-20180608171327/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:13 sosreport-lp1761442-a.1234-20180608171327/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-a:/tmp# ls -l sosreport-lp1761442-a.1234-20180608171327/sos_strings/logs/*
ls: cannot access 'sosreport-lp1761442-a.1234-20180608171327/sos_strings/logs/*': No such file or directory

root@lp1761442-a:/tmp# grep sosreport sosreport-lp1761442-a.1234-20180608175622/installed-debs
ii sosreport 3.5-1~ubuntu17.10.3 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-a:/tmp# ls -l sosreport-lp1761442-a.1234-20180608175622/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:56 sosreport-lp1761442-a.1234-20180608175622/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-a:/tmp# ls -l sosreport-lp1761442-a.1234-20180608175622/sos_strings/logs/var.log.syslog.tailed
-rw-r--r-- 1 root root 1048576 Jun 8 17:56 sosreport-lp1761442-a.1234-20180608175622/sos_strings/logs/var.log.syslog.tailed

Dan Streetman (ddstreet) wrote :

x:

root@lp1761442-x:/tmp# grep sosreport sosreport-lp1761442-x.1234-20180608172830/installed-debs
ii sosreport 3.5-1~ubuntu16.04.2 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-x:/tmp# cat sosreport-lp1761442-x.1234-20180608172830/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'

root@lp1761442-x:/tmp# ls -l sosreport-lp1761442-x.1234-20180608172830/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:28 sosreport-lp1761442-x.1234-20180608172830/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-x:/tmp# ls -l sosreport-lp1761442-x.1234-20180608172830/sos_strings/logs/*
ls: cannot access 'sosreport-lp1761442-x.1234-20180608172830/sos_strings/logs/*': No such file or directory

root@lp1761442-x:/tmp# grep sosreport sosreport-lp1761442-x.1234-20180608175839/installed-debs
ii sosreport 3.5-1~ubuntu16.04.3 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-x:/tmp# ls -l sosreport-lp1761442-x.1234-20180608175839/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:58 sosreport-lp1761442-x.1234-20180608175839/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-x:/tmp# ls -l sosreport-lp1761442-x.1234-20180608175839/sos_strings/logs/var.log.syslog.tailed
-rw-r--r-- 1 root root 1048576 Jun 8 17:58 sosreport-lp1761442-x.1234-20180608175839/sos_strings/logs/var.log.syslog.tailed

Dan Streetman (ddstreet) wrote :

t:

root@lp1761442-t:/tmp# grep sosreport sosreport-lp1761442-t.1234-20180608172851/installed-debs
ii sosreport 3.5-1~ubuntu14.04.2 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-t:/tmp# cat sosreport-lp1761442-t.1234-20180608172851/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'

root@lp1761442-t:/tmp# ls -l sosreport-lp1761442-t.1234-20180608172851/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 17:28 sosreport-lp1761442-t.1234-20180608172851/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-t:/tmp# ls -l sosreport-lp1761442-t.1234-20180608172851/sos_strings/logs/*
ls: cannot access sosreport-lp1761442-t.1234-20180608172851/sos_strings/logs/*: No such file or directory

root@lp1761442-t:/tmp# grep sosreport sosreport-lp1761442-t.1234-20180608180029/installed-debs
ii sosreport 3.5-1~ubuntu14.04.3 amd64 Set of tools to gather troubleshooting data from a system
root@lp1761442-t:/tmp# ls -l sosreport-lp1761442-t.1234-20180608180029/var/log/syslog
lrwxrwxrwx 1 root root 44 Jun 8 18:00 sosreport-lp1761442-t.1234-20180608180029/var/log/syslog -> ../../sos_strings/logs/var.log.syslog.tailed
root@lp1761442-t:/tmp# ls -l sosreport-lp1761442-t.1234-20180608180029/sos_strings/logs/var.log.syslog.tailed
-rw-r--r-- 1 root root 1048576 Jun 8 18:00 sosreport-lp1761442-t.1234-20180608180029/sos_strings/logs/var.log.syslog.tailed

tags: added: verification-done verification-done-artful verification-done-bionic verification-done-trusty verification-done-xenial
removed: verification-needed verification-needed-artful verification-needed-bionic verification-needed-trusty verification-needed-xenial

------- Comment From <email address hidden> 2018-06-11 05:31 EDT-------
(In reply to comment #17)
> However I see new issue with
>
> root@ubuntu1604:~# sudo add-apt-repository ppa:ddstreet/lp1761442
>
> More info: https://launchpad.net/~ddstreet/+archive/ubuntu/lp1761442
> Press [ENTER] to continue or ctrl-c to cancel adding it
>
>
> gpg: keyring `/tmp/tmp5_zskxu2/secring.gpg' created
> gpg: keyring `/tmp/tmp5_zskxu2/pubring.gpg' created
> gpg: requesting key 52D2BD8D from hkp server keyserver.ubuntu.com
> gpg: /tmp/tmp5_zskxu2/trustdb.gpg: trustdb created
> gpg: key 52D2BD8D: public key "Launchpad PPA for Dan Streetman" imported
> gpg: Total number processed: 1
> gpg: imported: 1 (RSA: 1)
> OK
> root@ubuntu1604:~#
> root@ubuntu1604:~# sudo add-apt-repository ppa:ddstreet/lp1761442
> Segmentation fault
> ^^^^
> [ 392.031762] add-apt-reposit[4571]: unhandled signal 11 at
> c0000000000086d8 nip 00003fff90f52a58 lr 00003fff90eda4dc code 30001
> `
>
> Observing this in every alternate run of add-apt-repository run
> dmesg has `

With latest Ubuntu 16.04.4 LTS I am not able to hit this issue.

Changed in ubuntu-power-systems:
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 3.5-1ubuntu3.18.04.1

---------------
sosreport (3.5-1ubuntu3.18.04.1) bionic; urgency=medium

  * d/p/Fix-string-decoding-for-debug-log-output.patch:
    Fix bug in _collect_strings that causes error trying to str.decode()
    (LP: #1761442)

 -- Dan Streetman <email address hidden> Tue, 05 Jun 2018 10:52:56 -0400

Changed in sosreport (Ubuntu Bionic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for sosreport has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 3.5-1~ubuntu17.10.3

---------------
sosreport (3.5-1~ubuntu17.10.3) artful; urgency=medium

  * d/p/Fix-string-decoding-for-debug-log-output.patch:
    Fix bug in _collect_strings that causes error trying to str.decode()
    (LP: #1761442)

 -- Dan Streetman <email address hidden> Tue, 05 Jun 2018 10:52:56 -0400

Changed in sosreport (Ubuntu Artful):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 3.5-1~ubuntu16.04.3

---------------
sosreport (3.5-1~ubuntu16.04.3) xenial; urgency=medium

  * d/p/Fix-string-decoding-for-debug-log-output.patch:
    Fix bug in _collect_strings that causes error trying to str.decode()
    (LP: #1761442)

 -- Dan Streetman <email address hidden> Tue, 05 Jun 2018 10:52:56 -0400

Changed in sosreport (Ubuntu Xenial):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 3.5-1~ubuntu14.04.3

---------------
sosreport (3.5-1~ubuntu14.04.3) trusty; urgency=medium

  * d/p/Fix-string-decoding-for-debug-log-output.patch:
    Fix bug in _collect_strings that causes error trying to str.decode()
    (LP: #1761442)

 -- Dan Streetman <email address hidden> Tue, 05 Jun 2018 10:52:56 -0400

Changed in sosreport (Ubuntu Trusty):
status: Fix Committed → Fix Released
Manoj Iyer (manjo) on 2018-06-18
Changed in ubuntu-power-systems:
status: Fix Committed → Fix Released
Changed in sosreport:
status: New → Fix Released
bugproxy (bugproxy) on 2018-09-24
tags: added: targetmilestone-inin16044
removed: targetmilestone-inin---
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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