Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-57594

[Leapp] `dnf config-manager setopt` to exclude packages fails with a python traceback

    • No
    • Moderate
    • rhel-sst-upgrades
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • All
    • None

      What were you trying to do that didn't work?

      Leapp ends with a traceback raised from dnf while trying to exclude a few packages:

      2024-09-05 04:56:18.366 ERROR    PID: 30455 leapp.workflow.TargetTransactionCheck.dnf_transaction_check: Cannot set the dnf configuration

      Please provide the package NVR for which bug is seen:

      leapp-upgrade-el7toel8-0.20.0-9.el7_9.noarch

      Note: for the customer, the issue happened while in-place upgrading 7>8, and I reproduced the issue in the same env. Nevertheless, I guess the same issue happens during 8>9.

      How reproducible:

      Always

      Steps to reproduce

      1. touch /etc/leapp/files/dnf.conf
      2. leapp preupgrade --debug

      Actual results

      Risk Factor: high (error)
      Title: Actor dnf_transaction_check unexpectedly terminated with exit code: 1
      Summary: Traceback (most recent call last):
        File "/usr/lib/python2.7/site-packages/leapp/repository/actor_definition.py", line 74, in _do_run
          actor_instance.run(*args, **kwargs)
        File "/usr/lib/python2.7/site-packages/leapp/actors/__init__.py", line 289, in run
          self.process(*args)
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/dnftransactioncheck/actor.py", line 47, in process
          xfs_info=xfs_info, storage_info=storage_info, plugin_info=plugin_info, target_iso=target_iso
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfplugin.py", line 498, in perform_transaction_check
          dnfconfig.exclude_leapp_rpms(context, disable_plugins)
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.py", line 126, in exclude_leapp_rpms
          _set_excluded_pkgs(context, to_exclude, disable_plugins)
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.py", line 107, in _set_excluded_pkgs
          context.call(cmd)
        File "/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/mounting.py", line 168, in call
          return run(self.type.make_command(cmd), *args, **kwargs)
        File "/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/__init__.py", line 192, in run
          result=result
      CalledProcessError: Command ['systemd-nspawn', '--register=no', '--quiet', '-D', u'/var/lib/leapp/el8userspace', '--setenv=LEAPP_UPGRADE_PATH_TARGET_RELEASE=8.10', '--setenv=LEAPP_NO_RHSM=0', '--setenv=LEAPP_EXPERIMENTAL=0', '--setenv=LEAPP_TARGET_PRODUCT_CHANNEL=ga', '--setenv=LEAPP_UPGRADE_PATH_FLAVOUR=default', '--setenv=LEAPP_COMMON_TOOLS=:/etc/leapp/repos.d/system_upgrade/common/tools:/etc/leapp/repos.d/system_upgrade/el7toel8/tools', '--setenv=LEAPP_COMMON_FILES=:/etc/leapp/repos.d/system_upgrade/common/files:/etc/leapp/repos.d/system_upgrade/el7toel8/files', '--setenv=LEAPP_IPU_IN_PROGRESS=7to8', '--setenv=LEAPP_UNSUPPORTED=0', '--setenv=LEAPP_EXECUTION_ID=bd2c4280-bc1d-4e73-b41f-9cd64c4ba82b', '--setenv=LEAPP_HOSTNAME=localhost.localdomain', 'dnf', 'config-manager', '--save', '--setopt', 'exclude=python2-leapp,snactor,leapp-upgrade-el7toel8,leapp'] failed with exit code 1.
      

      Notes:

      • being a .ini file, it seems dnf.conf also requires a [main] section.
      • `/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfconfig.py` also reports the following warning: "
        Cannot parse the dnf dump correctly, line: without precising the line, since the file was empty.

              leapp-notifications leapp-notifications
              rhn-support-cbesson Christophe Besson
              leapp-notifications leapp-notifications
              RHEL Upgrades QE Team RHEL Upgrades QE Team
              Miriam Portman Miriam Portman
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: