sosreport: AttributeError: 'str' object has no attribute 'decode'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
The Ubuntu-power-systems project |
Fix Released
|
High
|
Canonical Server | ||
sosreport |
Fix Released
|
Unknown
|
|||
sosreport (Ubuntu) |
Fix Released
|
High
|
Dan Streetman | ||
Trusty |
Fix Released
|
High
|
Dan Streetman | ||
Xenial |
Fix Released
|
High
|
Dan Streetman | ||
Artful |
Fix Released
|
High
|
Dan Streetman | ||
Bionic |
Fix Released
|
High
|
Dan Streetman | ||
Cosmic |
Fix Released
|
High
|
Dan Streetman |
Bug Description
[impact]
sosreport plugin(s) fail
[test case]
run sosreport, then extract the captured report and check the sos_logs/
Traceback (most recent call last):
File "/usr/share/
plug.collect()
File "/usr/share/
self.
File "/usr/share/
(content.
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:
Traceback (most recent call last):
File "/usr/share/
plug.collect()
File "/usr/share/
self.
File "/usr/share/
(content.
AttributeError: 'str' object has no attribute 'decode'
root@guest:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
root@guest:
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:/
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) |
tags: | added: triage-g |
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) |
Changed in sosreport: | |
status: | Unknown → New |
Changed in ubuntu-power-systems: | |
status: | Triaged → Incomplete |
Changed in sosreport (Ubuntu): | |
status: | In Progress → Incomplete |
Changed in ubuntu-power-systems: | |
status: | Incomplete → In Progress |
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 |
tags: | added: patch |
Changed in sosreport (Ubuntu): | |
status: | In Progress → Fix Committed |
description: | updated |
description: | updated |
Changed in ubuntu-power-systems: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-power-systems: | |
status: | Fix Committed → Fix Released |
Changed in sosreport: | |
status: | New → Fix Released |
tags: |
added: targetmilestone-inin16044 removed: targetmilestone-inin--- |
affecting ppc64el, but not limited to it