RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2075720 - sos report collects data from container instead of host due to symlinks
Summary: sos report collects data from container instead of host due to symlinks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sos
Version: 8.5
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Jan Jansky
QA Contact: Miroslav Hradílek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-15 00:04 UTC by Derrick Ornelas
Modified: 2023-11-24 04:25 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-26 08:37:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github sosreport sos pull 3245 0 None Merged [Plugin|Archive] Fix handling of symlink resolution within containers 2023-06-27 13:58:50 UTC
Red Hat Issue Tracker RHELPLAN-119043 0 None None None 2022-04-15 00:06:02 UTC

Description Derrick Ornelas 2022-04-15 00:04:32 UTC
Description of problem:  Some of the data, specifically /etc/os-release, collected when running sos report on a RHCOS node via toolbox is from the support-tools container and not the host.  


Version-Release number of selected component (if applicable):
sos-4.1-9.el8_5
toolbox-0.0.8-4.rhaos4.10.el8
rhel8/support-tools:8.5-18 container image


How reproducible:  100%


Steps to Reproduce:
1.  Run toolbox on RHCOS 410.84.202202251620-0 node
2.  Run sos report in the toolbox container


Actual results:

The collected contents of /etc/os-release will be from the support-tools container

# cat /var/tmp/sosreport-worker1-2022-04-14-yqrdmxj/etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.5 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.5 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.5
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.5"



Expected results:

The collected contens of /etc/os-release are from the host RHCOS node

# cat /etc/os-release 
NAME="Red Hat Enterprise Linux CoreOS"
VERSION="410.84.202202251620-0"
ID="rhcos"
ID_LIKE="rhel fedora"
VERSION_ID="4.10"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux CoreOS 410.84.202202251620-0 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::coreos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://docs.openshift.com/container-platform/4.10/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="OpenShift Container Platform"
REDHAT_BUGZILLA_PRODUCT_VERSION="4.10"
REDHAT_SUPPORT_PRODUCT="OpenShift Container Platform"
REDHAT_SUPPORT_PRODUCT_VERSION="4.10"
OPENSHIFT_VERSION="4.10"
RHEL_VERSION="8.4"
OSTREE_VERSION='410.84.202202251620-0'




Additional info:

# pwd
/var/tmp/sosreport-worker1-2022-04-14-yqrdmxj

# ls -l /etc/os-release
lrwxrwxrwx. 1 root root 21 Mar 11 23:04 /etc/os-release -> ../usr/lib/os-release

# ls -l /var/tmp/sosreport-worker1-2022-04-14-yqrdmxj/etc/os-release 
lrwxrwxrwx. 1 root root 21 Oct  7  2021 /var/tmp/sosreport-worker1-2022-04-14-yqrdmxj/etc/os-release -> ../usr/lib/os-release

# head -n1 /etc/os-release
NAME="Red Hat Enterprise Linux CoreOS"

# head -n1 /var/tmp/sosreport-worker1-2022-04-14-yqrdmxj/etc/os-release
NAME="Red Hat Enterprise Linux"


# toolbox
Spawning a container 'toolbox-root' with image 'registry.redhat.io/rhel8/support-tools'
Detected RUN label in the container image. Using that as the default...

[root@worker1 /]# head -n1 /etc/os-release
NAME="Red Hat Enterprise Linux"

[root@worker1 /]# head -n1 /host/etc/os-release
NAME="Red Hat Enterprise Linux CoreOS"

# ls -l /host/etc/os-release
lrwxrwxrwx. 1 root root 21 Mar 11 23:04 /host/etc/os-release -> ../usr/lib/os-release

# head -n1 ../usr/lib/os-release
NAME="Red Hat Enterprise Linux"


So, sos follows the symlink and gets os-release contents from the container.  There may be other files where the same thing is happening, but I haven't fully explored that yet.

Comment 1 Pavel Moravec 2022-05-08 15:44:21 UTC
I do feel we have fixed such sort of an issue but I cant find when; could you please try it with sos-4.2 or sos-4.3 or current upstream (e.g. from https://github.com/sosreport/sos/releases)?

Comment 2 Derrick Ornelas 2022-05-26 00:11:44 UTC
This doesn't appear to be fixed in 4.2 or 4.3


* Testing sos-4.2

# toolbox 
Spawning a container 'toolbox-root' with image 'registry.redhat.io/rhel8/support-tools'
Detected RUN label in the container image. Using that as the default...

[root@worker1 /]# rpm -q sos
sos-4.2-15.el8.noarch

[root@worker1 /]# sos report --batch

sosreport (version 4.2)

This command will collect diagnostic and configuration information from
this Red Hat CoreOS system.
[...]
  Finished running plugins

Creating compressed archive...

Your sosreport has been generated and saved in:
	/host/var/tmp/sosreport-worker1-2022-05-25-atsvalj.tar.xz

 Size	88.83MiB
 Owner	root
 sha256	e5f4d1a0f92e6d2543c053afb30b2aeec88d03fb125243f353d84f407dfec63c

Please send this file to your support representative.


[root@worker1 /]# exit
exit

# cd /var/tmp/ && tar xf sosreport-worker1-2022-05-25-atsvalj.tar.xz

# cat sosreport-worker1-2022-05-25-atsvalj/etc/os-release 
NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"


# cat /etc/os-release 
NAME="Red Hat Enterprise Linux CoreOS"
VERSION="410.84.202204261500-0"
ID="rhcos"
ID_LIKE="rhel fedora"
VERSION_ID="4.10"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux CoreOS 410.84.202204261500-0 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::coreos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://docs.openshift.com/container-platform/4.10/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="OpenShift Container Platform"
REDHAT_BUGZILLA_PRODUCT_VERSION="4.10"
REDHAT_SUPPORT_PRODUCT="OpenShift Container Platform"
REDHAT_SUPPORT_PRODUCT_VERSION="4.10"
OPENSHIFT_VERSION="4.10"
RHEL_VERSION="8.4"
OSTREE_VERSION='410.84.202204261500-0'





* Testing sos-4.3

# podman rm toolbox-root
8fd28056c32728fd9cf2cf9c6663b4023b32bebbf22f78b97412fcf2d9e0e3d1

# toolbox 
Spawning a container 'toolbox-root' with image 'registry.redhat.io/rhel8/support-tools'
Detected RUN label in the container image. Using that as the default...

[root@worker1 /]# rpm -Uvh http://download-node-02.eng.bos.redhat.com/brewroot/packages/sos/4.3/1.el8/noarch/sos-4.3-1.el8.noarch.rpm
Retrieving http://download-node-02.eng.bos.redhat.com/brewroot/packages/sos/4.3/1.el8/noarch/sos-4.3-1.el8.noarch.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:sos-4.3-1.el8                    ################################# [ 50%]
Cleaning up / removing...
   2:sos-4.2-15.el8                   ################################# [100%]


[root@worker1 /]# sos report -o release --batch 

sosreport (version 4.3)

WARNING: unable to set option for disabled or non-existing plugin (networking).

This command will collect diagnostic and configuration information from
this Red Hat CoreOS system.
[...]
  Starting 1/1   release         [Running: release]

  Finished running plugins

Creating compressed archive...

Your sosreport has been generated and saved in:
	/host/var/tmp/sosreport-worker1-2022-05-26-etxvnhy.tar.xz

 Size	2.87KiB
 Owner	root
 sha256	f203c8c928f10d43869d6ef244087d8697a8bdbcee98c298db699248848b1337

Please send this file to your support representative.

[root@worker1 /]# exit
exit

# cd /var/tmp/ && tar xf sosreport-worker1-2022-05-26-etxvnhy.tar.xz

# cat sosreport-worker1-2022-05-26-etxvnhy/etc/os-release 
NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"

Comment 5 Pavel Moravec 2023-06-27 13:58:50 UTC
a candidate to sos-4.5.5 build

Comment 6 Jan Jansky 2023-06-30 14:06:18 UTC
Will you be able to test the fix for us when we will have release candidate?

Comment 7 Derrick Ornelas 2023-07-05 22:12:22 UTC
Yes, I can test the fix

Comment 15 errata-xmlrpc 2023-07-26 08:37:56 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/RHBA-2023:4279

Comment 16 Red Hat Bugzilla 2023-11-24 04:25:04 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.