Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
1. node roles parsing can't handle miltiple roles
# sos collect --no-local -vvv
[sos_collector:get_nodes_from_cluster] Node list: []
[sos_collector:reduce_node_list] Node list reduced to []
=> Use role=worker, since it can be parsed properly.
2. No way to figure out the error, /var/tmp/sos.wxnmrktg doesn't exist
# sos collect --no-local -c ocp.role=worker -vvv
WARNING: Unable to read configuration file /etc/sos/sos.conf : No such file or directory
[sos_collector:__init__] Executing /usr/local/bin/sos collect --no-local -c ocp.role=worker -vvv
[sos_collector:__init__] Found cluster profiles: dict_keys(['jbon', 'kubernetes', 'ocp', 'rhosp', 'ovirt', 'rhhi_virt', 'rhv', 'pacemaker', 'satellite'])
sos-collector (version 4.4)
...
[sos_collector:configure_sos_cmd] Initial sos cmd set to sosreport --batch -c auto
[sos_collector:prep] password not specified, assuming SSH keys
sos-collector ASSUMES that SSH keys are installed on all nodes unless the
--password option is provided.
Optionally, please enter the case id that you are generating this report for []:
[localhost:run_command] Running command hostname
[thinkpad:_get_hostname] Hostname set to thinkpad
[localhost:determine_host_policy] using local policy Ubuntu
[ocp] oc base command set to oc
[thinkpad:run_command] Running command oc whoami
[sos_collector:determine_cluster] Installation matches ocp, checking for layered profiles
Cluster type set to OpenShift Container Platform v4
[thinkpad:run_command] Running command oc auth can-i '*' '*'
[ocp] Creating new temporary project 'sos-collect-tmp'
[thinkpad:run_command] Running command oc new-project sos-collect-tmp
[thinkpad:run_command] Running command oc get nodes -o wide
[sos_collector:get_nodes_from_cluster] Node list: ['ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq', 'ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw', 'ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw']
[sos_collector:reduce_node_list] Node list reduced to ['ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq', 'ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw', 'ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw']
The following is a list of nodes to collect from:
ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq
ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw
ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw
Press ENTER to continue with these nodes, or press CTRL-C to quit
[archive:TarFileArchive] initialised empty FileCacheArchive at '/var/tmp/sos.wxnmrktg/sos-collector-2022-08-23-zkgib'
[archive:TarFileArchive] created directory at 'sos_logs' in FileCacheArchive '/var/tmp/sos.wxnmrktg/sos-collector-2022-08-23-zkgib'
Connecting to nodes...
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_connect] Starting sos collector container 'ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq-sos-collector'
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_connect] Starting sos collector container 'ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw-sos-collector'
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_connect] Starting sos collector container 'ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw-sos-collector'
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_connect] Unable to deploy sos collect pod
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_connect] Unable to deploy sos collect pod
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_connect] Debug pod deployment failed:
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_connect] Unable to deploy sos collect pod
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_connect] Debug pod deployment failed:
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_connect] Debug pod deployment failed:
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:read_file] Reading file /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:read_file] Reading file /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:read_file] Reading file /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:read_file] Reading file /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:read_file] Reading file /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:read_file] Reading file /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:run_command] Running command cat /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:run_command] Running command cat /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:run_command] Running command cat /etc/os-release
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_read_file] Error reading /etc/os-release: [' pods "ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq-sos-collector" not found\r\n']
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_read_file] Error reading /etc/os-release: [' pods "ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw-sos-collector" not found\r\n']
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_read_file] Error reading /etc/os-release: [' pods "ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw-sos-collector" not found\r\n']
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:determine_host_policy] loaded policy Ubuntu for host
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:determine_host_policy] loaded policy Ubuntu for host
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:determine_host_policy] loaded policy Ubuntu for host
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_disconnect] Calling delete on pod 'ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq-sos-collector' failed: {'status': 1, 'output': '', 'truncated': False}
[ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:disconnect] Unable to successfully disconnect, see log for more details
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_disconnect] Calling delete on pod 'ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw-sos-collector' failed: {'status': 1, 'output': '', 'truncated': False}
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:disconnect] Unable to successfully disconnect, see log for more details
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_disconnect] Calling delete on pod 'ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw-sos-collector' failed: {'status': 1, 'output': '', 'truncated': False}
[ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:disconnect] Unable to successfully disconnect, see log for more details
[thinkpad:run_command] Running command oc delete project sos-collect-tmp
[thinkpad:run_command] Running command oc wait namespace/sos-collect-tmp --for=delete --timeout=30s
[thinkpad:run_command] Running command oc project default
No nodes connected. Aborting...
3. After a manual tweak to see the error
diff --git a/sos/utilities.py b/sos/utilities.py
index 2046c8fd..c83e693a 100644
--- a/sos/utilities.py
+++ b/sos/utilities.py
@@ -156,7 +156,7 @@ def sos_get_command_output(command, timeout=TIMEOUT_DEFAULT, stderr=False,
proc.terminate()
raise SoSTimeoutError
time.sleep(0.01)
-
+ stderr = True
cmd_env = os.environ.copy()
# ensure consistent locale for collected command output
cmd_env['LC_ALL'] = 'C.UTF-8'
we can see podSecurity failure
# sos collect --no-local -c ocp.role=worker -vvv
[ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_connect] Debug pod deployment failed: Error from server (Forbidden): error when creating "/var/tmp/sos.2wd3loxw/tmpsgo1_0ih": pods "ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw-sos-collector" is forbidden: violates PodSecurity "restricted:v1.24": host namespaces (hostNetwork=true, hostPID=true, hostIPC=true), privileged (container "sos-collector-tmp" must not set securityContext.privileged=true), allowPrivilegeEscalation != false (container "sos-collector-tmp" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "sos-collector-tmp" must set securityContext.capabilities.drop=["ALL"]), restricted volume types (volumes "host", "run", "varlog", "machine-id" use restricted volume type "hostPath"), runAsNonRoot != true (pod or container "sos-collector-tmp" must set securityContext.runAsNonRoot=true), runAsUser=0 (container "sos-collector-tmp" must not set runAsUser=0), seccompProfile (pod or container "sos-collector-tmp" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
Version-Release number of selected component (if applicable):
Used sos collect 4.4 from upstream (all other sos collect version should fail the same way, knowing the problem)
How reproducible:
Always
Additional info:
Works with older versions of Openshift
Re-Opening this bug for SOS!
In short we need to run the following:
> oc label namespace <namespace> security.openshift.io/scc.podSecurityLabelSync=false
> oc label namespace <namespace> pod-security.kubernetes.io/enforce=privileged
After creating the namespace in https://github.com/sosreport/sos/blob/main/sos/collector/clusters/ocp.py#L140-L143
Or just create the namespace with these labels (IE: oc create -f namespace.yaml).
Will those labels cause any issues on older OCP clusters? Or can we just add them to the stock namespace config? If we need to version-gate the use of those labels that's fine too, but if they can be added to older clusters without causing problems we can just make this an across the board change.
(In reply to RamaKasturi from comment #19)
> Tested with the scratch build provided above in comment 17 and i see that it
> works fine. Detailed verification steps are present in the jira here, thanks
> !!
>
> https://issues.redhat.com/browse/RHELPLAN-131968
My bad s/scratch build/official build
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-2022:7732
Description of problem: 1. node roles parsing can't handle miltiple roles # sos collect --no-local -vvv [sos_collector:get_nodes_from_cluster] Node list: [] [sos_collector:reduce_node_list] Node list reduced to [] => Use role=worker, since it can be parsed properly. 2. No way to figure out the error, /var/tmp/sos.wxnmrktg doesn't exist # sos collect --no-local -c ocp.role=worker -vvv WARNING: Unable to read configuration file /etc/sos/sos.conf : No such file or directory [sos_collector:__init__] Executing /usr/local/bin/sos collect --no-local -c ocp.role=worker -vvv [sos_collector:__init__] Found cluster profiles: dict_keys(['jbon', 'kubernetes', 'ocp', 'rhosp', 'ovirt', 'rhhi_virt', 'rhv', 'pacemaker', 'satellite']) sos-collector (version 4.4) ... [sos_collector:configure_sos_cmd] Initial sos cmd set to sosreport --batch -c auto [sos_collector:prep] password not specified, assuming SSH keys sos-collector ASSUMES that SSH keys are installed on all nodes unless the --password option is provided. Optionally, please enter the case id that you are generating this report for []: [localhost:run_command] Running command hostname [thinkpad:_get_hostname] Hostname set to thinkpad [localhost:determine_host_policy] using local policy Ubuntu [ocp] oc base command set to oc [thinkpad:run_command] Running command oc whoami [sos_collector:determine_cluster] Installation matches ocp, checking for layered profiles Cluster type set to OpenShift Container Platform v4 [thinkpad:run_command] Running command oc auth can-i '*' '*' [ocp] Creating new temporary project 'sos-collect-tmp' [thinkpad:run_command] Running command oc new-project sos-collect-tmp [thinkpad:run_command] Running command oc get nodes -o wide [sos_collector:get_nodes_from_cluster] Node list: ['ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq', 'ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw', 'ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw'] [sos_collector:reduce_node_list] Node list reduced to ['ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq', 'ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw', 'ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw'] The following is a list of nodes to collect from: ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw Press ENTER to continue with these nodes, or press CTRL-C to quit [archive:TarFileArchive] initialised empty FileCacheArchive at '/var/tmp/sos.wxnmrktg/sos-collector-2022-08-23-zkgib' [archive:TarFileArchive] created directory at 'sos_logs' in FileCacheArchive '/var/tmp/sos.wxnmrktg/sos-collector-2022-08-23-zkgib' Connecting to nodes... [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_connect] Starting sos collector container 'ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq-sos-collector' [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_connect] Starting sos collector container 'ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw-sos-collector' [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_connect] Starting sos collector container 'ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw-sos-collector' [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_connect] Unable to deploy sos collect pod [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_connect] Unable to deploy sos collect pod [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_connect] Debug pod deployment failed: [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_connect] Unable to deploy sos collect pod [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_connect] Debug pod deployment failed: [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_connect] Debug pod deployment failed: [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:read_file] Reading file /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:read_file] Reading file /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:read_file] Reading file /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:read_file] Reading file /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:read_file] Reading file /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:read_file] Reading file /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:run_command] Running command cat /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:run_command] Running command cat /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:run_command] Running command cat /etc/os-release [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_read_file] Error reading /etc/os-release: [' pods "ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq-sos-collector" not found\r\n'] [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_read_file] Error reading /etc/os-release: [' pods "ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw-sos-collector" not found\r\n'] [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_read_file] Error reading /etc/os-release: [' pods "ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw-sos-collector" not found\r\n'] [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:determine_host_policy] loaded policy Ubuntu for host [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:determine_host_policy] loaded policy Ubuntu for host [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:determine_host_policy] loaded policy Ubuntu for host [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:_disconnect] Calling delete on pod 'ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq-sos-collector' failed: {'status': 1, 'output': '', 'truncated': False} [ci-ln-yt40m6t-72292-8xrb4-worker-a-hg2nq:disconnect] Unable to successfully disconnect, see log for more details [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_disconnect] Calling delete on pod 'ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw-sos-collector' failed: {'status': 1, 'output': '', 'truncated': False} [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:disconnect] Unable to successfully disconnect, see log for more details [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:_disconnect] Calling delete on pod 'ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw-sos-collector' failed: {'status': 1, 'output': '', 'truncated': False} [ci-ln-yt40m6t-72292-8xrb4-worker-c-rfddw:disconnect] Unable to successfully disconnect, see log for more details [thinkpad:run_command] Running command oc delete project sos-collect-tmp [thinkpad:run_command] Running command oc wait namespace/sos-collect-tmp --for=delete --timeout=30s [thinkpad:run_command] Running command oc project default No nodes connected. Aborting... 3. After a manual tweak to see the error diff --git a/sos/utilities.py b/sos/utilities.py index 2046c8fd..c83e693a 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -156,7 +156,7 @@ def sos_get_command_output(command, timeout=TIMEOUT_DEFAULT, stderr=False, proc.terminate() raise SoSTimeoutError time.sleep(0.01) - + stderr = True cmd_env = os.environ.copy() # ensure consistent locale for collected command output cmd_env['LC_ALL'] = 'C.UTF-8' we can see podSecurity failure # sos collect --no-local -c ocp.role=worker -vvv [ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw:_connect] Debug pod deployment failed: Error from server (Forbidden): error when creating "/var/tmp/sos.2wd3loxw/tmpsgo1_0ih": pods "ci-ln-yt40m6t-72292-8xrb4-worker-b-lrjnw-sos-collector" is forbidden: violates PodSecurity "restricted:v1.24": host namespaces (hostNetwork=true, hostPID=true, hostIPC=true), privileged (container "sos-collector-tmp" must not set securityContext.privileged=true), allowPrivilegeEscalation != false (container "sos-collector-tmp" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "sos-collector-tmp" must set securityContext.capabilities.drop=["ALL"]), restricted volume types (volumes "host", "run", "varlog", "machine-id" use restricted volume type "hostPath"), runAsNonRoot != true (pod or container "sos-collector-tmp" must set securityContext.runAsNonRoot=true), runAsUser=0 (container "sos-collector-tmp" must not set runAsUser=0), seccompProfile (pod or container "sos-collector-tmp" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost") Version-Release number of selected component (if applicable): Used sos collect 4.4 from upstream (all other sos collect version should fail the same way, knowing the problem) How reproducible: Always Additional info: Works with older versions of Openshift