Bug 1827801

Summary: rebase to sos 4 in RHEL8.4
Product: Red Hat Enterprise Linux 8 Reporter: Pavel Moravec <pmoravec>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav Hradílek <mhradile>
Severity: high Docs Contact:
Priority: high    
Version: 8.4CC: agk, bmr, cww, mhradile, plambri, sbradley
Target Milestone: rcKeywords: Rebase
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sos-4.0-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 14:47:21 UTC Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1894575    

Description Pavel Moravec 2020-04-24 20:09:08 UTC
Description of problem:
sos 4.0 will be an evolution step in the sos project, that (upon other traditional types of improvements):
- adds a new command layer on the top of sosreport, such that today's sosreport becomes "sos report"
- integrates sos-collector natively under the sos umbrella as "sos collect"
- possible other sub-commands might be implemented (compare, clean)

We should reflect those changes in downstream RHEL8 as well. Depending on particular timing, we might be able rebase to sos 4.[0-2].

Filing this rebase BZ this way soon to let everybody (incl. QE) to prepare for the bigger change.


Version-Release number of selected component (if applicable):
sos-3.*


How reproducible:
100%


Steps to Reproduce:
1. rpm -q sos
2. sos report
3. sos collect
4. sos has weak dependency (Recommends) on python3-pexpect required to have "sos collect" functional
5. sos newly obsoletes sos-collector


Actual results:
1. sos-3.*
2. and 3.: neither works today


Expected results:
1. sos-4.*
2. and 3.: both provide expected functionality, while "sosreport" is an acronym of "sos report" with a deprecation warning message


Additional info:

Comment 5 Miroslav Hradílek 2021-01-28 15:30:11 UTC
Verified manually on RHEL-8.3.0 x86_64.

Old:
====
1)
# rpm -q sos
sos-3.9.1-6.el8.noarch

2)
# sos report
-bash: /usr/sbin/sos: No such file or directory

4)
# rpm -q --recommends sos
#

5)
# rpm -q --obsoletes sos
#

3)
# sos collect
-bash: /usr/sbin/sos: No such file or directory

6)
# sos clean
-bash: /usr/sbin/sos: No such file or directory

New:
====
1)
# rpm -q sos
sos-4.0-6.el8.noarch

2)
# sos report
. . .
sosreport (version 4.0)
. . .
Your sosreport has been generated and saved in:
	/var/tmp/sosreport-alphahost-2021-01-28-hazirco.tar.xz
. . .

4)
# rpm -q --recommends sos
python3-pexpect

5)
# rpm -q --obsoletes sos
sos-collector

# rpm -q sos sos-collector
sos-3.9.1-6.el8.noarch
sos-collector-1.8-2.el8.noarch

# yum install sos-4.0-6.el8.noarch.rpm
. . .
Upgrading:
 sos                    noarch                    4.0-6.el8                     @commandline                    686 k
     replacing  sos-collector.noarch 1.8-2.el8
. . .
# rpm -q sos sos-collector
sos-4.0-6.el8.noarch
package sos-collector is not installed

3) // sos collect
# ssh-keygen -t rsa -f $HOME/.ssh/id_rsa -N ''
# ssh-copy-id root@betahost
# hostname
alphahost
# sos collect --cluster-type jbon --node betahost
. . .
sos-collector (version 4.0)
. . .
Please enter the case id you are collecting reports for: 111
. . .
The following is a list of nodes to collect from:
	alphahost
	betahost
. . .
Beginning collection of sosreports from 2 nodes, collecting a maximum of 4 concurrently

alphahost  : Generating sosreport...
betahost  : Generating sosreport...
betahost  : Retrieving sosreport...
betahost  : Successfully collected sosreport
alphahost  : Retrieving sosreport...
alphahost  : Successfully collected sosreport

The following archive has been created. Please provide it to your support team.
	/var/tmp/sos-collector-111-2021-01-28-kxebq.tar.xz

# tar -tf /var/tmp/sos-collector-111-2021-01-28-kxebq.tar.xz
sos-collector-111-2021-01-28-kxebq/
sos-collector-111-2021-01-28-kxebq/sos_logs/
sos-collector-111-2021-01-28-kxebq/sos_logs/sos.log
sos-collector-111-2021-01-28-kxebq/sos_logs/ui.log
sos-collector-111-2021-01-28-kxebq/sosreport-alphahost-111-2021-01-28-zafkfcr.tar.xz
sos-collector-111-2021-01-28-kxebq/checksums/
sos-collector-111-2021-01-28-kxebq/checksums/sosreport-alphahost-111-2021-01-28-zafkfcr.tar.xz.md5
sos-collector-111-2021-01-28-kxebq/checksums/sosreport-betahost-111-2021-01-28-hvmotlt.tar.xz.md5
sos-collector-111-2021-01-28-kxebq/sosreport-betahost-111-2021-01-28-hvmotlt.tar.xz
sos-collector-111-2021-01-28-kxebq/sos_reports/
sos-collector-111-2021-01-28-kxebq/sos_reports/manifest.json
# tar -xf /var/tmp/sos-collector-111-2021-01-28-kxebq.tar.xz

# tar -tf sos-collector-111-2021-01-28-kxebq/sosreport-alphahost-111-2021-01-28-zafkfcr.tar.xz  | grep /etc/hostname
sosreport-alphahost-111-2021-01-28-zafkfcr/etc/hostname
# tar -xf sos-collector-111-2021-01-28-kxebq/sosreport-alphahost-111-2021-01-28-zafkfcr.tar.xz
# cat sosreport-alphahost-111-2021-01-28-zafkfcr/etc/hostname
alphahost


# tar -tf sos-collector-111-2021-01-28-kxebq/sosreport-betahost-111-2021-01-28-hvmotlt.tar.xz  | grep /etc/hostname
sosreport-betahost-111-2021-01-28-hvmotlt/etc/hostname
# tar -xf sos-collector-111-2021-01-28-kxebq/sosreport-betahost-111-2021-01-28-hvmotlt.tar.xz
# cat sosreport-betahost-111-2021-01-28-hvmotlt/etc/hostname
betahost

I also successfully tried:
# sos collect --cluster-type jbon --node betahost -o host --batch

and options propagated.

6) // sos clean
# sos report -o host --batch
. . .
# tar -tf /var/tmp/sosreport-alphahost-2021-01-28-gvcctqq.tar.xz | grep hostname
sosreport-alphahost-2021-01-28-gvcctqq/sos_commands/host/hostname
sosreport-alphahost-2021-01-28-gvcctqq/sos_commands/host/hostname_-f
sosreport-alphahost-2021-01-28-gvcctqq/sos_commands/host/hostnamectl_status
sosreport-alphahost-2021-01-28-gvcctqq/hostname
# tar -xf /var/tmp/sosreport-alphahost-2021-01-28-gvcctqq.tar.xz
# cat sosreport-alphahost-2021-01-28-gvcctqq/sos_commands/host/hostname
alphahost

# sos clean /var/tmp/sosreport-alphahost-2021-01-28-gvcctqq.tar.xz
. . .
sos clean (version 4.0)
. . .
[cleaner] Could not update mapping config file: [Errno 2] No such file or directory: '/etc/sos/cleaner/default_mapping'
A mapping of obfuscated elements is available at
	/var/tmp/sosreport-host0-2021-01-28-gvcctqq-private_map

The obfuscated archive is available at
	/var/tmp/sosreport-host0-2021-01-28-gvcctqq-obfuscated.tar.xz
. . .
# tar -tf /var/tmp/sosreport-host0-2021-01-28-gvcctqq-obfuscated.tar.xz | grep hostname
sosreport-host0-2021-01-28-gvcctqq/sos_commands/host/hostname
sosreport-host0-2021-01-28-gvcctqq/sos_commands/host/hostname_-f
sosreport-host0-2021-01-28-gvcctqq/sos_commands/host/hostnamectl_status
sosreport-host0-2021-01-28-gvcctqq/hostname
# tar -xf /var/tmp/sosreport-host0-2021-01-28-gvcctqq-obfuscated.tar.xz
# cat sosreport-host0-2021-01-28-gvcctqq/sos_commands/host/hostname
host0.obfuscateddomain1.com

I also tried on unpacked dir and it worked the same:
# sos clean sosreport-alphahost-17-2021-01-28-gvcctqq
. . .
# cat /var/tmp/sosreport-host0-2021-01-28-gvcctqq/hostname 
host0.obfuscateddomain1.com

Comment 7 errata-xmlrpc 2021-05-18 14:47:21 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 (sos bug fix and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHEA-2021:1604