Skip to content

Commit

Permalink
Merge pull request #28 from Akrog/download-error-debug
Browse files Browse the repository at this point in the history
Temporary debugging for SOS gathering
  • Loading branch information
fmount authored Nov 29, 2023
2 parents ea4c956 + 20229ad commit ff9d708
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion collection-scripts/gather_edpm_sos
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ gather_edpm_sos () {

echo "Retrieving SOS Report for ${node}"
mkdir -p "${SOS_PATH_NODES}/sosreport-$node"
SSH sudo "cat ${TMPDIR}/*.tar.xz" | tar --one-top-level="${SOS_PATH_NODES}/sosreport-$node" --strip-components=1 --exclude='*/dev/null' -Jxf -
SSH sudo "cat ${TMPDIR}/*.tar.xz" | tee "${SOS_PATH_NODES}/sosreport-$node.tar.xz" | tar --one-top-level="${SOS_PATH_NODES}/sosreport-$node" --strip-components=1 --exclude='*/dev/null' -Jxf -

# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
echo "Failed to download and decompress sosreport-$node.tar.xz not deleting file"
return 1
fi
rm "${SOS_PATH_NODES}/sosreport-$node.tar.xz"

# Ensure write access to the sos reports directories so must-gather rsync doesn't fail
chmod +w -R "${SOS_PATH_NODES}/sosreport-$node/"
Expand Down
3 changes: 2 additions & 1 deletion collection-scripts/gather_sos
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ gather_node_sos () {
echo "Retrieving SOS Report for ${node}"
mkdir "${SOS_PATH_NODES}/sosreport-$node"
# Add "--loglevel 6" to help debug in case there's a failure
oc debug --loglevel 6 "node/$node" -- cat "/host${TMPDIR}/*.tar.xz" | tar --one-top-level="${SOS_PATH_NODES}/sosreport-$node" --strip-components=1 --exclude='*/dev/null' -Jxf -
oc debug --loglevel 6 "node/$node" -- bash -c "cat \"/host${TMPDIR}/\"*.tar.xz" | tee "${SOS_PATH_NODES}/sosreport-$node.tar.xz" | tar --one-top-level="${SOS_PATH_NODES}/sosreport-$node" --strip-components=1 --exclude='*/dev/null' -Jxf -

# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
echo "Failed to download and decompress sosreport-$node.tar.xz not deleting file"
return 1
fi
rm "${SOS_PATH_NODES}/sosreport-$node.tar.xz"

# Ensure write access to the sos reports directories so must-gather rsync doesn't fail
chmod +w -R "${SOS_PATH_NODES}/sosreport-$node/"
Expand Down

0 comments on commit ff9d708

Please sign in to comment.