← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1761442] Re: sosreport: AttributeError: 'str' object has no attribute 'decode'

 

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 <ddstreet@xxxxxxxxxxxxx>  Tue, 05 Jun 2018 10:52:56
-0400

** Changed in: sosreport (Ubuntu Artful)
       Status: Fix Committed => Fix Released

** Changed in: sosreport (Ubuntu Xenial)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1761442

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

Status in sosreport:
  New
Status in The Ubuntu-power-systems project:
  Fix Committed
Status in sosreport package in Ubuntu:
  Fix Released
Status in sosreport source package in Trusty:
  Fix Released
Status in sosreport source package in Xenial:
  Fix Released
Status in sosreport source package in Artful:
  Fix Released
Status in sosreport source package in Bionic:
  Fix Released
Status in sosreport source package in Cosmic:
  Fix Released

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 <sthoufee@xxxxxxxxxx> - 2018-04-05 04:53:10 ==
  identified this commit will fix the issue.

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/sosreport/+bug/1761442/+subscriptions