plesk / centos2alma

CentOS 7 to AlmaLinux 8 conversion tool
Apache License 2.0
38 stars 8 forks source link

Checks failed when checking if the latest installed kernel is in use #259

Closed jalarcon666 closed 2 months ago

jalarcon666 commented 4 months ago

Doing preparation checks... Preparation checks failed: Exception during checking of required pre-conversion condition 'checking if the last installed kernel is in use' Traceback (most recent call last): File "/root/centos2alma/pleskdistup/common/src/action.py", line 466, in make_checks if not check.do_check(): File "/root/centos2alma/pleskdistup/common/src/action.py", line 438, in do_check return self._do_check() File "/root/centos2alma/centos2almaconverter/actions/common_checks.py", line 95, in _do_check last_installed_kernel_version = self._get_last_installed_kernel_version() File "/root/centos2alma/centos2almaconverter/actions/common_checks.py", line 84, in _get_last_installed_kernel_version return max(versions) ValueError: max() arg is an empty sequence

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/centos2alma/pleskdistup/main.py", line 106, in required_conditions_satisfied failed_checks = check_flow.make_checks() File "/root/centos2alma/pleskdistup/common/src/action.py", line 471, in make_checks raise RuntimeError(f"Exception during checking of required pre-conversion condition {check.name!r}") from e RuntimeError: Exception during checking of required pre-conversion condition 'checking if the last installed kernel is in use'

------DIST & PANEL INFO------

CentOS Linux release 7.9.2009 (Core) 3.10.0-957.21.3.el7.centos.plus.x86_64 #1 SMP Tue Jun 18 21:13:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Product version: Plesk Obsidian 18.0.61.3 OS version: CentOS 7.9.2009 x86_64 Build date: 2024/05/21 14:00 Revision: a9196f8fa585ec9441dc7782c8f0c69c48126da0

I attach debugging files

SandakovMM commented 4 months ago

Hello, It seems like there is an issue with the package manager. It looks like we were unable to get a list of installed packages using the command "/usr/bin/yum --list installed". Can you please provide the output of this command? Also, could you please run the command "centos2alma --verbose" and share the contents of the file "/var/log/plesk/centos2alma"?

Ricardo-AlterTable commented 4 months ago

Hello, It seems like there is an issue with the package manager. It looks like we were unable to get a list of installed packages using the command "/usr/bin/yum --list installed". Can you please provide the output of this command? Also, could you please run the command "centos2alma --verbose" and share the contents of the file "/var/log/plesk/centos2alma"?

Hello, I am a colleague of Jalarcon666,

The output of that command is:

Complementos cargados:fastestmirror Usage: yum [options] COMMAND

List of Commands:

check Verifica si hay problemas en la base de datos (rpmdb) check-update Verifica la existencia de actualizaciones de paquetes clean Elimina los datos del caché deplist Muestra las dependencias que necesita un paquete distribution-synchronization Sincroniza los paquetes instalados a las últimas versiones disponibles downgrade desactualizar un paquete a una versión anterior erase Elimina uno o varios paquetes de su sistema fs Acts on the filesystem data of the host, mainly for removing docs/lanuages for minimal hosts. fssnapshot Creates filesystem snapshots, or lists/deletes current snapshots. groups Muestra, o usa, la información de grupos help Muestra un mensaje de ayuda del uso history Mostrar, o utilizar, el historial de la transacción info Muestra detalles acerca de un paquete o de un grupo de paquetes install Instala uno o varios paquetes en su sistema list Muestra un paquete o grupos de paquete load-transaction carga una transacción guardada desde un archivo makecache Genera el caché de metadatos provides Localiza el paquete que ofrezca el valor indicado reinstall reinstalar un paquete repo-pkgs Tratar un repositorio como un grupo de paquetes, de este modo instala/borra todos ellos repolist Muestra los repositorios de software configurados search Busca detalles en los paquetes para la cadena indicada shell Ejecuta una shell de Yum interactiva swap Simple way to swap packages, instead of using shell update Actualiza uno o varios paquetes en su sistema update-minimal Works like upgrade, but goes to the 'newest' package match which fixes a problem that affects your system updateinfo Acts on repository update information upgrade Actualiza los paquetes tomando en cuenta los obsoletos version Muestra una versión para la máquina y/o los repositorios disponibles.

Error en la línea de comando: no such option: --list

The correct way to launch that command is "/usr/bin/yum list installed" without "--"

mynetnc commented 4 months ago

Did you manage to get it to work ? I have the same issue (and the same result to the yum command : Erreur sur la ligne de commande : no such option: --list

mynetnc commented 4 months ago

Here are my feedback files : centos2alma_feedback.zip

SandakovMM commented 4 months ago

I will address the issue with the list in a several days. However, this might not resolve the original problem. I believe the problem occurs because the kernel package name installed on the server is unexpected by centos2alma. Currently, we only support kernel, kernel-rt, and kernel-plus. Could you please provide the name of your kernel package?

Ricardo-AlterTable commented 4 months ago

I will address the issue with the list in a several days. However, this might not resolve the original problem. I believe the problem occurs because the kernel package name installed on the server is unexpected by centos2alma. Currently, we only support kernel, kernel-rt, and kernel-plus. Could you please provide the name of your kernel package?

3.10.0-957.21.3.el7.centos.plus.x86_64

SandakovMM commented 4 months ago

I mean full name of the package. For example you could provide list of all kernel related packages by rpm -q -a kern*

Ricardo-AlterTable commented 4 months ago

rpm -q -a kern*

kernel-plus-devel-3.10.0-957.21.3.el7.centos.plus.x86_64 kernel-plus-tools-libs-3.10.0-1160.88.1.el7.centos.plus.x86_64 kernel-plus-headers-3.10.0-1160.88.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-1160.80.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-1160.81.1.el7.centos.plus.x86_64 kernel-plus-devel-3.10.0-1160.88.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-1160.83.1.el7.centos.plus.x86_64 kernel-plus-devel-3.10.0-1160.83.1.el7.centos.plus.x86_64 kernel-plus-tools-3.10.0-1160.88.1.el7.centos.plus.x86_64 kernel-plus-devel-3.10.0-1160.81.1.el7.centos.plus.x86_64 kernel-plus-devel-3.10.0-1160.80.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-1160.88.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-957.21.3.el7.centos.plus.x86_64

mynetnc commented 4 months ago

Mine went like this :

rpm -q -a kern*
kernel-headers-3.10.0-1160.118.1.el7.x86_64

:thinking: yum install kernel-3.10.0-1160.118.1.el7.x86_64 did it, now centos2alma is doin' its job ! Thank you !

SandakovMM commented 4 months ago

@Ricardo-AlterTable, I noticed you have kernel-plus installed, which should be fine for centos2alma. However, I can't tell why the tool not recognizing it. Could you please provide the output of the following command: /usr/bin/rpm -q -a kernel kernel-plus kernel-rt-core. This is actually the command we are using to retrieve kernel list.

@mynetnc, thank you for your feedback. I need to fix this issue on the centos2alma side

Ricardo-AlterTable commented 4 months ago

/usr/bin/rpm -q -a kernel kernel-plus kernel-rt-core

kernel-plus-3.10.0-1160.80.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-1160.81.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-1160.83.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-1160.88.1.el7.centos.plus.x86_64 kernel-plus-3.10.0-957.21.3.el7.centos.plus.x86_64

;)

SandakovMM commented 4 months ago

Ok, something is wrong here) Let me think what we can do on centos2alma side to recognize and prevent the problem.

computertech-ca commented 3 months ago

Hello. I'm having a similar issue I believe. I run: ./centos2alma and get:

"Preparation checks failed: Exception during checking of required pre-conversion condition 'checking if the last installed kernel is in use' Traceback (most recent call last): File "/root/centos2alma/pleskdistup/common/src/action.py", line 471, in make_checks if not check.do_check(): File "/root/centos2alma/pleskdistup/common/src/action.py", line 443, in do_check return self._do_check() File "/root/centos2alma/centos2almaconverter/actions/common_checks.py", line 88, in _do_check last_installed_kernel_version = self._get_last_installed_kernel_version() File "/root/centos2alma/centos2almaconverter/actions/common_checks.py", line 85, in _get_last_installed_kernel_version return max(versions) ValueError: max() arg is an empty sequence

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/centos2alma/pleskdistup/main.py", line 107, in required_conditions_satisfied failed_checks = check_flow.make_checks() File "/root/centos2alma/pleskdistup/common/src/action.py", line 474, in make_checks raise RuntimeError(f"Exception during checking of required pre-conversion condition {check.name!r}") from e RuntimeError: Exception during checking of required pre-conversion condition 'checking if the last installed kernel is in use'

Conversion can't be performed due to the problems noted above"

I ran rpm -q -a kern* and got this "kernel-headers-3.10.0-1160.118.1.el7.x86_64" Thank you for any assistance you can give me!

SandakovMM commented 3 months ago

Hello @computertech-ca,

I ran rpm -q -a kern* and got this "kernel-headers-3.10.0-1160.118.1.el7.x86_64"

It seems that there is no kernel package installed on the target machine, only the kernel-headers package. To fix this issue, you should install the kernel. Similar to the suggestion in this comment.

jalarcon666 commented 3 months ago

Hello, any news with the main error of the incident? @SandakovMM

SandakovMM commented 3 months ago

Hello @jalarcon666, I am still investigating the cause and attempting to reproduce the issue. For now, I recommend switching to the standard kernel instead of kernel-plus. You will need to install the standard kernel anyway because Leapp will not work without a RHEL-signed kernel installed (it checks for any "kernel" or "kernel-rt" packages).

SandakovMM commented 3 months ago

The issue with the empty sequence exception should be resolved by #280. I've attached an archive with the updated version of centos2alma. centos2alma.zip However, this change does not address the missing kernel-plus issue. To continue with the conversion, you will need to install the kernel package elsewhere due to leapp's restrictions.

Ricardo-AlterTable commented 3 months ago

The issue with the empty sequence exception should be resolved by #280. I've attached an archive with the updated version of centos2alma. centos2alma.zip However, this change does not address the missing kernel-plus issue. To continue with the conversion, you will need to install the kernel package elsewhere due to leapp's restrictions.

ok, then I understand that servers that have kernel-plus will not be able to do the conversion without first installing the normal kernel and then restarting to run said kernel

it's true?

It would also be interesting to add this to the Requirements part ;)

Thanks for your help!

SandakovMM commented 3 months ago

it's true?

You are correct. I am not sure why these requirements exist in Leapp anyway. It seems to be a decision made by Red Hat.

Requirements part

Good point. I will add this information to the documentation and likely update the pre-checks.

ecoyork-dneveloff commented 3 months ago

Hello,

I am receiving a similar error. Here are my outputs with their respective commands below as well as my error. Any additional insight you could provide? Thank you!

`Doing preparation checks... Preparation checks failed: Exception during checking of required pre-conversion condition 'checking if the last installed kernel is in use' Traceback (most recent call last): File "/home/ecoadmin_usr/centos2alma/pleskdistup/common/src/action.py", line 471, in make_checks if not check.do_check(): File "/home/ecoadmin_usr/centos2alma/pleskdistup/common/src/action.py", line 443, in do_check return self._do_check() File "/home/ecoadmin_usr/centos2alma/centos2almaconverter/actions/common_checks.py", line 89, in _do_check used_kernel_version = self._get_kernel_version_in_use() File "/home/ecoadmin_usr/centos2alma/centos2almaconverter/actions/common_checks.py", line 74, in _get_kernel_version_in_use return version.KernelVersion(curr_kernel) File "/home/ecoadmin_usr/centos2alma/pleskdistup/common/src/version.py", line 66, in init self._extract_with_build(version) File "/home/ecoadmin_usr/centos2alma/pleskdistup/common/src/version.py", line 16, in _extract_with_build main_part, secondary_part = version.split("-") ValueError: too many values to unpack (expected 2)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/ecoadmin_usr/centos2alma/pleskdistup/main.py", line 107, in required_conditions_satisfied failed_checks = check_flow.make_checks() File "/home/ecoadmin_usr/centos2alma/pleskdistup/common/src/action.py", line 474, in make_checks raise RuntimeError(f"Exception during checking of required pre-conversion condition {check.name!r}") from e RuntimeError: Exception during checking of required pre-conversion condition 'checking if the last installed kernel is in use'

Conversion can't be performed due to the problems noted above`

/usr/bin/rpm -q -a kernel kernel-plus kernel-rt-core

kernel-3.10.0-693.el7.x86_64 kernel-3.10.0-693.21.1.el7.x86_64 kernel-3.10.0-693.2.2.el7.x86_64

rpm -q -a kern*

kernel-tools-3.10.0-693.21.1.el7.x86_64 kernel-tools-libs-3.10.0-693.21.1.el7.x86_64 kernel-headers-3.10.0-693.21.1.el7.x86_64 kernel-3.10.0-693.el7.x86_64 kernel-3.10.0-693.21.1.el7.x86_64 kernel-3.10.0-693.2.2.el7.x86_64

/usr/bin/uname -r 6.2.9-x86_64-linode160

SandakovMM commented 3 months ago

Hello @ecoyork-dneveloff, The issue lies in the uname -r output. I will fix the tool's failure in parsing the uname results. Unfortunately, this will not resolve your issue because you are using a non-standard kernel version. To proceed with the conversion, please switch to the latest installed standard kernel.

jalarcon666 commented 3 months ago

Hello @SandakovMM after changing from kernel-plus to the normal CentOS kernel we have a new error related to grub2, grub2 is not being used, we use grub

Possible solutions?

/var/log/plesk/centos2alma.log

image

/var/log/leapp/leapp-preupgrade.log

image

image

SandakovMM commented 3 months ago

Hello @jalarcon666, According to [Red Hat's Leapp documentation (section 4.1)](Red Hat Documentation](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html-single/upgrading_from_rhel_7_to_rhel_8/index), grub2 is necessary for the conversion. Additionally, Leapp does not verify if grub2 is installed and simply tries to access its configuration files, which further confirms that grub2 is needed. So unfortunately, to proceed with the conversion, you must install grub2


I will add this information to the README.md file and include a pre-checker.

SandakovMM commented 2 months ago

I have added the grub2 pre-checker (#316), included additional requirements for grub and RHEL-signed kernels in the README.md, and fixed the parsing of Linode kernels (#314). Please note that this does not mean we support Linode kernels for conversion; I only fixed the exception. IIRC this addresses everything we discussed for this issue, so I am closing it. Thank you for all your help.