mrjoshuap / ansible-leapp

An Ansible role that attempts an inplace upgrade of EL7 to EL8 using LEAPP
GNU General Public License v2.0
15 stars 12 forks source link

leapp preupgrade step fails #3

Open dcmirandah opened 2 years ago

dcmirandah commented 2 years ago

Hi, On the leapp preupgrade step the playbook fails with the following errors:

==> Processing phase `configuration_phase`
====> * ipu_workflow_config
        IPU workflow config actor
==> Processing phase `FactsCollection`
====> * scancpu
        Scan CPUs of the machine.
====> * source_boot_loader_scanner
        Scans the boot loader configuration on the source system.
====> * tcp_wrappers_config_read
        Parse tcp_wrappers configuration files /etc/hosts.{allow,deny}.
====> * storage_scanner
        Provides data about storage settings.
====> * scan_custom_repofile
        Scan the custom /etc/leapp/files/leapp_upgrade_repositories.repo repo file.
====> * removed_pam_modules_scanner
        Scan PAM configuration for modules that are not available in RHEL-8.
====> * scan_files_for_target_userspace
        Scan the source system and identify files that will be copied into the target userspace when it is created.
====> * network_manager_read_config
        Provides data about NetworkManager configuration.
====> * scan_kernel_cmdline
        No documentation has been provided for the scan_kernel_cmdline actor.
====> * system_facts
        Provides data about many facts from system.
Process Process-199:
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/systemfacts/actor.py", line 36, in process
    self.produce(systemfacts.get_sysctls_status())
  File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py", line 170, in get_sysctls_status
    return SysctlVariablesFacts(sysctl_variables=_get_sysctls())
  File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py", line 22, in inner
    return list(f(*args, **kwargs))
  File "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py", line 143, in _get_sysctls
    for sc in run(['sysctl', '-a'], split=True)['stdout']:"
  File "/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/__init__.py", line 188, in run
    result=result
CalledProcessError: Command ['sysctl', '-a'] failed with exit code 1.
============================================================================================="
Actor system_facts unexpectedly terminated with exit code: 1 - Please check the above details"
=============================================================================================
============================================================
                           ERRORS                           
============================================================
2022-04-13 16:21:34.524115 [ERROR] Actor: source_boot_loader_scanner"
Message: Failed to call `grubby` to list available boot entries."
Summary:"
    Details: Command ['grubby', '--info', 'ALL'] failed with exit code 1."
    Stderr: Process Process-183:"
            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/el7toel8/actors/sourcebootloaderscanner/actor.py", line 18, in process"
                scan_source_boot_loader_configuration()"
              File "/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/actors/sourcebootloaderscanner/libraries/sourcebootloaderscanner.py", line 54, inscan_source_boot_loader_configuration",
                entries=scan_boot_entries()"
              File "/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/actors/sourcebootloaderscanner/libraries/sourcebootloaderscanner.py", line 17, inscan_boot_entries",
                grubby_output = run(CMD_GRUBBY_INFO_ALL, split=True)"
              File "/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/__init__.py", line 181, in run"
                stdin=stdin, env=env, encoding=encoding)"
              File "/usr/lib/python2.7/site-packages/leapp/libraries/stdlib/call.py", line 217, in _call"
                os.execvpe(command[0], command, env=environ)"
              File "/usr/lib64/python2.7/os.py", line 353, in execvpe"
                _execvpe(file, args, env)"
              File "/usr/lib64/python2.7/os.py", line 380, in _execvpe"
                func(fullname, *argrest)
            OSError: [Errno 2] No such file or directory
============================================================
                       END OF ERRORS                        
============================================================
Debug output written to /var/log/leapp/leapp-preupgrade.log
============================================================
                           REPORT                           
============================================================
A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt
============================================================
                       END OF REPORT                        
============================================================
Answerfile has been generated at /var/log/leapp/answerfile

Do you have any idea why this happens? I've also tried to run the command leapp preupgrade with the modules ansible.builtin.raw and ansible.builtin.shell. When I run the command manually on the server via an ssh connection, I get a full report without any errors.

It seems that not a lot of people are trying to automate the upgrade in place process with Ansible. I've opened 2 discussions about this error: https://access.redhat.com/discussions/6921941 https://www.reddit.com/r/ansible/comments/u2sne2/upgrade_rhel79_to_8x_with_leapp_using_ansible/?utm_source=share&utm_medium=web2x&context=3

pilipit commented 1 year ago

Late to the party but I hope this helps: What you're encountering has something to do with the PATH variable not inheriting the root user's PATH value. More info here: https://unix.stackexchange.com/questions/318179/have-a-command-in-my-path-but-it-is-not-being-recognized-when-i-use-sudo