Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix storage scanner parsing error #1258

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

tomasfratrik
Copy link
Member

The given error arises when storage scanner actor attempts to parse output from command pvs while output containts separator symbol within itself. Changed the format of physical volume as was suggested in the ticket so it contains separator :, and was given following error while preupgrade and upgrade.
(e.g: format of physical volume, contains the symbol : `/dev/disk/by-path/pci-0000:00:03.0-part2)

  File "/etc/leapp/repos.d/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py", line 195, in _get_pvs_info
    pv, vg, fmt, attr, psize, pfree = entry
ValueError: too many values to unpack (expected 6)

Therefore changing the separation symbol to |, and running preupgrade and upgrade from RHEL8 to RHEL9 didn't raise any errors.

Jira: RHEL-34570

Copy link

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

  • review please @oamg/developers to notify leapp developers of the review request
  • /packit copr-build to submit a public copr build using packit

Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build.
However, here are additional useful commands for packit:

  • /packit test to re-run manually the default tests
  • /packit retest-failed to re-run failed tests manually
  • /packit test oamg/leapp#42 to run tests with leapp builds for the leapp PR#42 (default is latest upstream - master - build)

Note that first time contributors cannot run tests automatically - they need to be started by a reviewer.

It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported, beaker-minimal and kernel-rt, both can be used to be run on all upgrade paths or just a couple of specific ones.
To launch on-demand tests with packit:

  • /packit test --labels kernel-rt to schedule kernel-rt tests set for all upgrade paths
  • /packit test --labels beaker-minimal-8.10to9.4,kernel-rt-8.10to9.4 to schedule kernel-rt and beaker-minimal test sets for 8.10->9.4 upgrade path

See other labels for particular jobs defined in the .packit.yaml file.

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra.

@pirat89 pirat89 added this to the 8.10/9.6 milestone Jul 2, 2024
@pirat89
Copy link
Member

pirat89 commented Jul 4, 2024

@tomasfratrik rebase against master. tests should be fixed now

@tomasfratrik tomasfratrik force-pushed the output-parse-storagescanner-fix branch from 37dd3a9 to d8b36ad Compare July 8, 2024 07:48
@matejmatuska
Copy link
Member

/packit retest-failed

2 similar comments
@tomasfratrik
Copy link
Member Author

/packit retest-failed

@matejmatuska
Copy link
Member

/packit retest-failed

@tomasfratrik tomasfratrik force-pushed the output-parse-storagescanner-fix branch from d8b36ad to d2cfdd0 Compare August 5, 2024 14:24
@matejmatuska
Copy link
Member

@tomasfratrik Works as expected now, please squash the commits and I can approve this.

@pirat89 pirat89 added the bug Something isn't working label Aug 7, 2024
@tomasfratrik tomasfratrik force-pushed the output-parse-storagescanner-fix branch from dfc7600 to 69bbd72 Compare August 15, 2024 07:33
@tomasfratrik
Copy link
Member Author

The latest push squashes commits.

@pirat89 pirat89 removed this from the 8.10/9.6 milestone Sep 20, 2024
@MichalHe
Copy link
Member

/packit retest-failed

@MichalHe
Copy link
Member

/packit test

@tomasfratrik tomasfratrik force-pushed the output-parse-storagescanner-fix branch from 69bbd72 to e3cc79a Compare January 13, 2025 11:45
@MichalHe
Copy link
Member

@tomasfratrik Hmm, if you step back and read the commit message with fresh eyes, it is not clear what does "this issue" refers to:

Output separators were before set to ':', but the output values (e.g.
from command 'pvs -a') could also contain this symbol,
therefore changing separator symbol fixes this issue.

Could you please rephrase the commit message describes the problem without ambiguous references?

Below, you can find my suggestion, but I feel that it is a bit too detailed, maybe there is a shorter one.

The storagescanner actor uses : as a separator when parsing the output of, e.g., pvs -a. However, this is problematic as, e.g., PCI paths in /dev/disk/by-path might contain : in their names. Since we split outputs of executed commands using this separator, having more : in the output than expected causes the actor to crash. This commit, therefore, changes the separator to |.

Fix storagescanner actor crash when parsing the output of,
e.g., 'pvs -a', which used ':' as a separator and caused errors.
The issue occurred because separator ':' is used to split the outputs of executed commands.
This commit resolves the problem by changing the separator to '|'.

Jira: RHEL-34570
@tomasfratrik tomasfratrik force-pushed the output-parse-storagescanner-fix branch from e3cc79a to a2d0e78 Compare January 13, 2025 13:28
@tomasfratrik
Copy link
Member Author

tomasfratrik commented Jan 13, 2025

Yes you are right about the commit message. There are many ambiguous references. So I took your suggestion and made concise version. lmk if I should change it again.

@MichalHe
Copy link
Member

I have retested the PR and it works as expected. LGTM!

@MichalHe MichalHe merged commit d183370 into oamg:main Jan 13, 2025
23 checks passed
@MichalHe MichalHe added the changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants