Bug 1260592

Summary: [7.2] sosreport encounters regex error while running openstack swift plugin.
Product: Red Hat OpenStack Reporter: Poornima <pkshiras>
Component: sosAssignee: Lee Yarwood <lyarwood>
Status: CLOSED ERRATA QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0 (Essex)CC: agk, bmr, dkutalek, gavin, nlevinki, plambri, rbiba, rhos-flags, sbradley, srevivo, yeylon
Target Milestone: asyncKeywords: Triaged, ZStream
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: sos-3.2-36.el7ost.1 Doc Type: Bug Fix
Doc Text:
Previously, the Swift sos plug-in used an incorrect regular expression for the location of the Swift configuration files. Consequently, irrelevant files matched the regular expression, and the plug-in encountered an error. This update fixes the regular expression. As a result, only the intended files match, and the error no longer occurs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 23:30:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 1259158    
Description Flags
see container.ring.gz none

Description Poornima 2015-09-07 10:45:31 UTC
Description of problem:
sosreport reports regex errors on openstack deployment.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. run below command for openstack profile or only openstack_swift plugin

# mkdir -p /tmp/bug/regex
# sosreport -p openstack --batch --tmp-dir /tmp/bug/regex
# sosreport -o openstack_swift --batch --tmp-dir /tmp/bug/regex

Actual results: Below errors are observed:

 Running 10/10: openstack_swift...        

[plugin:openstack_swift] regex substitution failed for '/etc/swift/container.builder' with: ''utf8' codec can't decode byte 0x80 in position 0: invalid start byte'
[plugin:openstack_swift] regex substitution failed for '/etc/swift/container.ring.gz' with: ''utf8' codec can't decode byte 0x8b in position 1: invalid start byte'
Creating compressed archive...

Expected results: sosreport must run without any errors.

Additional info:

1. sharing resultant sosreport in attachments: 

2. Shared patch to fix this: https://github.com/sosreport/sos/pull/636

Comment 1 Poornima 2015-09-07 10:49:12 UTC
Created attachment 1070946 [details]
see container.ring.gz

Comment 3 Pavel Moravec 2015-09-07 11:03:04 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1247630(In reply to Poornima from comment #0)
> Version-Release number of selected component (if applicable):
> sos-3.2-16.el7ost.3.noarch

Is it reproducible with some el7 (not el7ost) package?

If not, please reassign product/component like https://bugzilla.redhat.com/show_bug.cgi?id=1247630 has.

Comment 4 Bryn M. Reeves 2015-09-07 11:31:01 UTC
The openstack_swift plugin in sos-3.2-16.el7 does not do *ANY* regex processing:

$ rhpkg gitbuildhash sos-3.2-16.el7

$ git checkout 687b32d6f85696e0acb7e46f73b3d69a2524495a

$ rhpkg --dist=rhel-7.1 prep

$ grep postproc sos-3.2/sos/plugins/openstack_swift.py | wc -l

So this is nothing to do with the RHEL product or RHEL packages; please re-direct this bug to the OST sos maintainers.

I suspect it's a problem in:


Which maps to upstream:

commit 02ef6e2ba8d1a8fe4468aaa8be0ae88f8c74646a
Author: Lee Yarwood <lyarwood@redhat.com>
Date:   Wed Jul 15 15:42:50 2015 +0100

    [openstack] Ensure openstack passwords and secrets are obfuscated.
    - Add a postproc method to ceilometer, cinder, glance, hoirzon and swift.
    - Add missing keys to the remaining plugins.
    - Modify the regular expression used by all plugins to ignore commented
      out keys.
    - Modify all plugins to use do_path_regex_sub() to apply regex to all
      collected configuration files.
    Resolves: #574
    Signed-off-by: Lee Yarwood <lyarwood@redhat.com>

Comment 11 nlevinki 2015-11-19 07:23:08 UTC
automation passed

Comment 13 errata-xmlrpc 2015-11-19 23:30:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.