Bug 2151424
| Summary: | convert2rhel fails with "ValueError: need more than 1 value to unpack" | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Pradeep Jagtap <prjagtap> |
| Component: | convert2rhel | Assignee: | Michal Bocek <mbocek> |
| Status: | CLOSED ERRATA | QA Contact: | Upgrades and Supportability <upgrades-and-supportability> |
| Severity: | medium | Docs Contact: | Miriam Portman <mportman> |
| Priority: | unspecified | ||
| Version: | 7.9 | CC: | ddiblik, fgustavs, mbocek |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-03-14 10:10:55 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Workaround:
When convert2rhel rollback occurs, convert2rhel unregisters the system and removes subscription-manager, subscription-manager-rhsm-certificates and subscription-manager-rhsm packages
In this process, the /etc/rhsm/ca/redhat-uep.pem file is removed. (as part of subscription-manager-rhsm-certificates package removal)
Now before running convert2rhel again, we also need to download the SSL certificate which resolves the issue.
# curl --create-dirs -o /etc/rhsm/ca/redhat-uep.pem https://ftp.redhat.com/redhat/convert2rhel/redhat-uep.pem
[root@hosting01 ~]# repoquery --quiet --qf "%{BUILDTIME}\t%{VERSION}-%{RELEASE}\t%{REPOID}" kernel
Repo convert2rhel-for-rhel-7-rpms forced skip_if_unavailable=True due to: /etc/rhsm/ca/redhat-uep.pem <----- this line is creating mess
1667923576 3.10.0-1160.80.1.el7 updates
Thanks, Pradeep, for the investigation.
Indeed, our code is unable to handle this line of the repoquery output. The https://github.com/oamg/convert2rhel/pull/557 (https://issues.redhat.com/browse/RHELC-689) is not going to fix that. It's merely going to print out the repoquery output so that the user has more information on how to proceed/what went wrong, instead of seeing a traceback.
My suggestion to fix the issue in a more generic way so that we parse only the messages containing the information about the available kernels. Currently we exclude from parsing only lines that contain "listed more than once in the configuration" but that is too specific: https://github.com/oamg/convert2rhel/blob/v1.1/convert2rhel/checks.py#L753.
The bug was verified as a part of automated test suite on versions *convert2rhel-1.1-1.el7.noarch.rpm*/*convert2rhel-1.1-1.el8.noarch.rpm* and *convert2rhel-1.2-2.el7.noarch.rpm*/*convert2rhel-1.2-2.el8.noarch.rpm* with their respective results provided in the JIRA issue comments due to BZ comment limitations. See: https://issues.redhat.com/browse/RHELC-829?focusedCommentId=21861583&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-21861583 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 (convert2rhel 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/RHEA-2023:1197 |
Description of problem: ======================== Convert2rhel fails with below traceback and message Message: ---------- Repo convert2rhel-for-rhel-7-rpms forced skip_if_unavailable=True due to: /etc/rhsm/ca/redhat-uep.pem Traceback: ----------- FILE - Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/convert2rhel/main.py", line 94, in main checks.perform_pre_checks() File "/usr/lib/python2.7/site-packages/convert2rhel/checks.py", line 68, in perform_pre_checks is_loaded_kernel_latest() File "/usr/lib/python2.7/site-packages/convert2rhel/checks.py", line 661, in is_loaded_kernel_latest _, latest_kernel, repoid = packages[0] ValueError: need more than 1 value to unpack No changes were made to the system. Version-Release number of selected component (if applicable): ======================================================================== convert2rhel-1.0-1.el7.noarch How reproducible: =================== Steps to Reproduce: 1. Start conversion # convert2rhel -h 2. Proceed with yes option for below tasks: TASK - [Convert: Remove excluded packages] Continue with the system conversion? [y/n]: y TASK - [Convert: Subscription Manager - Replace] Continue with the system conversion? [y/n]: y 3. Now subscription-manager packages would be installed and system would be registered 4. Once system is registered and you get confirmation request for below task. Here provide n option to roll back transaction TASK - [Convert: Remove packages containing .repo files] Continue with the system conversion? [y/n]: n 5. Now if you rerun convert2rhel it does not proceed. Actual results: ================= 1. Last Messages on the console/terminal ---------8<---------8<---------8<---------8< [12/07/2022 09:23:06] TASK - [Prepare: Checking if the installed packages are up-to-date] ******* Loaded plugins: fastestmirror Repo convert2rhel-for-rhel-7-rpms forced skip_if_unavailable=True due to: /etc/rhsm/ca/redhat-uep.pem Loading mirror speeds from cached hostfile * base: mirror.myfahim.com * extras: mirrors.nhanhoa.com * updates: mirror.myfahim.com System is up-to-date. [12/07/2022 09:23:13] TASK - [Prepare: Checking if the loaded kernel version is the most recent] No changes were made to the system. ---------8<---------8<---------8<---------8< 2. Traceback in /var/log/convert2rhel/convert2rhel.log ---------8<---------8<---------8<---------8< [12/07/2022 09:23:13] TASK - [Prepare: Checking if the loaded kernel version is the most recent] [12/07/2022 09:23:13] FILE - Calling command 'repoquery --quiet --qf "%{BUILDTIME}\t%{VERSION}-%{RELEASE}\t%{REPOID}" kernel' [12/07/2022 09:23:13] FILE - Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/convert2rhel/main.py", line 94, in main checks.perform_pre_checks() File "/usr/lib/python2.7/site-packages/convert2rhel/checks.py", line 68, in perform_pre_checks is_loaded_kernel_latest() File "/usr/lib/python2.7/site-packages/convert2rhel/checks.py", line 661, in is_loaded_kernel_latest _, latest_kernel, repoid = packages[0] ValueError: need more than 1 value to unpack ---------8<---------8<---------8<---------8< Expected results: ================== Should be able to run convert2rhel again.