leapp preupgrade failed to select the BaseOS and Appstream repositories

Solution Unverified - Updated -

Issue

  • The leapp preupgrade command failed with the following error.
==> Processing phase `TargetTransactionFactsCollection`
====> * target_userspace_creator
        Initializes a directory to be populated as a minimal environment to run binaries from the target system.
Red Hat CodeReady Linux Builder for RHEL 8 x86_  12 MB/s | 5.7 MB     00:00

<... snip ...>

Traceback (most recent call last):
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python2.7/site-packages/leapp/repository/actor_definition.py", line 72, in _do_run
    actor_instance.run(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/leapp/actors/__init__.py", line 335, in run
    self.process(*args)
  File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/actor.py", line 52, in process
    userspacegen.perform()
  File "/usr/lib/python2.7/site-packages/leapp/utils/deprecation.py", line 42, in process_wrapper
    return target_item(*args, **kwargs)
  File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py", line 681, in perform
    _create_target_userspace(context, indata.packages, indata.files, target_repoids)
  File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py", line 655, in _create_target_userspace
    _prep_repository_access(context, target_path)
  File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py", line 246, in _prep_repository_access
    files_owned_by_rpms = _get_files_owned_by_rpms(target_context, '/etc/yum.repos.d')
  File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py", line 214, in _get_files_owned_by_rpms
    for fname in os.listdir(context.full_path(dirpath)):
OSError: [Errno 2] No such file or directory: '/var/lib/leapp/el8userspace/etc/yum.repos.d'
  • The following is the executed command in /var/log/leapp/leapp-preupgrade.log. The CodeReady repository only was used clearly. The BaseOS and AppStream repositries were not selected.
DEBUG    PID: XXXXX leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: External command has started: ['systemd-nspawn', '--register=no', '--quiet', '-D', '/var/lib/leapp/scratch/mounts/root_/system_overlay', <... snip ...> 'dnf', 'install', '-y', '--nogpgcheck', '--setopt=module_platform_id=platform:el8', '--setopt=keepcache=1', '--releasever', u'8.4', '--installroot', '/el8target', '--disablerepo', '*', '--enablerepo', u'codeready-builder-for-rhel-8-x86_64-rpms', 'dnf', 'dnf-command(config-manager)']

Environment

Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content