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.
Bug 2106065 - 'leapp preupgrade' traceback _sub_commands[cmdname].parser.error(leftover)
Summary: 'leapp preupgrade' traceback _sub_commands[cmdname].parser.error(leftover)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: leapp
Version: 8.6
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Petr Stodulka
QA Contact: Michal Macura
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-11 16:31 UTC by Corey Marthaler
Modified: 2022-11-08 10:46 UTC (History)
1 user (show)

Fixed In Version: leapp-0.15.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-08 09:46:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OAMG-7148 0 None None None 2022-07-11 16:41:16 UTC
Red Hat Issue Tracker RHELPLAN-127421 0 None None None 2022-07-11 16:41:21 UTC
Red Hat Product Errata RHBA-2022:7591 0 None None None 2022-11-08 09:47:02 UTC

Description Corey Marthaler 2022-07-11 16:31:17 UTC
Description of problem:
I assume this is due to an invalid or improper named boot volume or boom entry, either way, leapp should offer more in checking and warning the user than a traceback.



[root@hayes-01 ~]# boom create --backup --title "Root LV snapshot before changes" --rootlv rhel/root_snapshot_before_changes
WARNING - Boom grub2 integration is disabled in '/boot/../etc/default/boom'
Created entry with boot_id 8cc2b32:
  title Root LV snapshot before changes
  machine-id abaa31d7fbe14391b6f63b7fb4d617fc
  version 4.18.0-398.g366e.el8.kpq1.x86_64
  linux /vmlinuz-4.18.0-398.g366e.el8.kpq1.x86_64.boom0
  initrd /initramfs-4.18.0-398.g366e.el8.kpq1.x86_64.img.boom0
  options root=/dev/rhel/root_snapshot_before_changes ro rd.lvm.lv=rhel/root_snapshot_before_changes rhgb quiet
  grub_users $grub_users
  grub_arg --unrestricted
  grub_class kernel


[root@hayes-01 ~]# leapp -h
usage: leapp [-h] [--version]

Optional arguments:
  -h, --help  show this help message and exit
  --version   show program's version number and exit

[root@hayes-01 ~]# leapp preupgrade
Traceback (most recent call last):
  File "/usr/bin/leapp", line 11, in <module>
    load_entry_point('leapp==0.14.0', 'console_scripts', 'leapp')()
  File "/usr/lib/python3.6/site-packages/leapp/cli/__init__.py", line 43, in main
    cli.command.execute('leapp version {}'.format(VERSION))
  File "/usr/lib/python3.6/site-packages/leapp/utils/clicmd.py", line 105, in execute
    self._sub_commands[cmdname].parser.error(leftover)
KeyError: 'leapp'




Version-Release number of selected component (if applicable):
kernel-4.18.0-398.g366e.el8.kpq1    BUILT: Tue Jun  7 04:56:38 CDT 2022

[root@hayes-01 ~]# rpm -qi leapp
Name        : leapp
Version     : 0.14.0
Release     : 3.el8
Architecture: noarch
Install Date: Mon 11 Jul 2022 11:25:37 AM CDT
Group       : Unspecified
Size        : 61655
License     : ASL 2.0
Signature   : RSA/SHA256, Wed 15 Jun 2022 10:17:17 AM CDT, Key ID 199e2f91fd431d51
Source RPM  : leapp-0.14.0-3.el8.src.rpm
Build Date  : Fri 27 May 2022 06:04:55 AM CDT

Comment 1 Corey Marthaler 2022-07-11 16:33:06 UTC
Same thing for other cmds, something must not be installed properly?


[root@hayes-01 ~]# leapp upgrade --reboot
Traceback (most recent call last):
  File "/usr/bin/leapp", line 11, in <module>
    load_entry_point('leapp==0.14.0', 'console_scripts', 'leapp')()
  File "/usr/lib/python3.6/site-packages/leapp/cli/__init__.py", line 43, in main
    cli.command.execute('leapp version {}'.format(VERSION))
  File "/usr/lib/python3.6/site-packages/leapp/utils/clicmd.py", line 105, in execute
    self._sub_commands[cmdname].parser.error(leftover)
KeyError: 'leapp'

Comment 2 Petr Stodulka 2022-07-11 17:10:07 UTC
Hi, thanks for the report. It's unrelated to /boot and boom. The problem is caused just by wrong instalation. On the system is installed just the leapp framework, without leapp repositories for upgrades. So there is not discovered any leapp subcommand. All required packages needs to be installed, which can be done by:

  # dnf install leapp-upgrade

Or you can specifically install the specific package directly, e.g. leapp-upgrade-el8toel9 in your case.

We will replace the traceback by proper error msg to make it more clear, like:
  ,,The 'upgrade' subcommand has not been discovered. Possibly the particular leapp repository has not been installed?"

Comment 3 Petr Stodulka 2022-07-11 17:23:36 UTC
Note: It is important to understand that leapp component contains only the framework and basic utility (+ another devel/testing tools) to make the use of the framework more friendly. When the system should be upgraded, the proper leapp repository / repositories needs to be installed (which in our case installs also particular leapp CLI subcommands, like `preupgrade`, `upgrade`, ...). These repositories are provided by the leapp-repository component (srpm) on RHEL systems. To make it easy for people so they do not need to know how particular RPMs are named, we instruct them to install `leapp-upgrade` which covers all packages needed for the In-Place Upgrade.

But as written above, the traceback is unfortunate and we agree that proper error msg should be delivered.

Comment 4 Petr Stodulka 2022-08-23 16:14:47 UTC
This has been fixed in upstream by the following PR:
    https://github.com/oamg/leapp/pull/785

Comment 10 errata-xmlrpc 2022-11-08 09:46:56 UTC
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 (leapp 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:7591


Note You need to log in before you can comment on or make changes to this bug.