Fix SOS report extraction failure due to tar --one-top-level bug#132
Open
m4d3bug wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
Open
Fix SOS report extraction failure due to tar --one-top-level bug#132m4d3bug wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
m4d3bug wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
SOS report extraction fails with "Invalid cross-device link" errors on all files when using --one-top-level combined with --strip-components in GNU tar 1.34. This causes all SOS report directories to be empty, and since the original tar.xz is unconditionally deleted after extraction, the data is permanently lost. Fix by: 1. Replacing --one-top-level with -C (which achieves the same result of extracting into a specific directory without the bug) 2. Checking tar exit code before deleting the original archive, so the compressed file is preserved as fallback if extraction fails Tested with GNU tar 1.34 on RHEL 9 — before the fix all sosreport directories were empty (0 bytes, 17000+ extraction errors), after the fix 15000+ files extracted successfully (194MB). Closes openstack-k8s-operators#131
c8bd25f to
0a2c4fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SOS report extraction fails with
Invalid cross-device linkerrors on all files when using--one-top-levelcombined with--strip-componentsin GNU tar 1.34 (shipped with RHEL 9). This affects bothgather_sos(control plane nodes) andgather_edpm_sos(EDPM nodes).All SOS report directories end up empty (0 bytes), and since the original tar.xz is unconditionally deleted after the failed extraction, the data is permanently lost.
Root Cause
GNU tar 1.34 has a bug where
--one-top-levelcombined with--strip-componentstriggersInvalid cross-device linkerrors, even when source and destination are on the same filesystem. This is not a hard link or cross-filesystem issue — it affects all file types (regular files, directories, symlinks).Verified by testing:
Fix
--one-top-level=DIRwith-C DIRin bothgather_sosandgather_edpm_sos— achieves the same result (extract into a specific directory) without the bugtarexit code before deleting the original archive — if extraction fails, the compressed file is preserved as a fallbackTesting
Tested on RHEL 9 with GNU tar 1.34:
Invalid cross-device linkerrorsEnvironment
registry.redhat.io/rhoso-operators/openstack-must-gather-rhel9:1.0Closes #131