plesk / centos2alma

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

Unable to recognize short kernel version #282

Closed SandakovMM closed 3 weeks ago

SandakovMM commented 3 weeks ago

When uname -r returns short verson without arch and distro information, centos2alma fails with exception:

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 "centos2almaconverter/actions/common_checks.py", line 89, in _do_check
used_kernel_version = self._get_kernel_version_in_use()
File "centos2almaconverter/actions/common_checks.py", line 74, in _get_kernel_version_in_use
return version.KernelVersion(curr_kernel)
File "/root/centos2alma/pleskdistup/common/src/version.py", line 68, in __init__
self._extract_no_build(version)
File "/root/centos2alma/pleskdistup/common/src/version.py", line 48, in _extract_no_build
self.major, self.minor, self.patch, self.distro, self.arch = version.split(".")
ValueError: not enough values to unpack (expected 5, got 3)

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

Traceback (most recent call last):
File "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'
SandakovMM commented 3 weeks ago

Should be fixed by #283

ecoyork-dneveloff commented 2 weeks ago

Howdy! I posted on another issue thread you were assisting with. My return from /usr/bin/uname -r is below. My error is slightly different but also seems to be an issue with splitting the version.

6.2.9-x86_64-linode160

Sorry for posting on multiple threads, just wondering if my issue is more related to this.

`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`