-
Bug
-
Resolution: Done-Errata
-
Normal
-
rhel-8.10, rhel-9.7
-
anaconda-34.25.7.3-1.el9
-
No
-
Low
-
rhel-anaconda
-
12
-
1
-
False
-
False
-
-
No
-
None
-
Pass
-
RegressionOnly
-
Unspecified Release Note Type - Unknown
-
Unspecified
-
Unspecified
-
Unspecified
-
-
x86_64
-
None
What were you trying to do that didn't work?
Installing a RHEL machine with kickstart that loads a custom yum repository
What is the impact of this issue to you?
It works fine with kernel 4.18.0-553.42.1.el8_10.x86_64 but fails when kernel 4.18.0-553.47.1.el8_10.x86_64
Please provide the package NVR for which the bug is seen:
Any anaconda-core.el8_10.x86_64. All of them have the same unchanged version comparison.
File "/usr/lib64/python3.6/site-packages/pyanaconda/payload/utils.py", line 180, in version_cmp
return (first_version > second_version) - (first_version < second_version)
I even found anaconda-core-33.16.8.9-1.el8_8.x86_64 still having the same call
~~~
def version_cmp(v1, v2):
"""Compare two version number strings."""
first_version = LooseVersion(v1)
second_version = LooseVersion(v2)
return (first_version > second_version) - (first_version < second_version)
~~~
Any python3-3.6.*.el8_10.x86_64. I tested on python3-libs-3.6.8-51.el8.x86_64 that has below code for comparison.
~~~
def _gt_(self, other):
64 c = self.cmp(other) ->> File "/usr/lib64/python3.6/distutils/version.py", line 64, in __gt_
65 if c is NotImplemented:
66 return c
67 return c > 0
267 class LooseVersion (Version):
<SNIP>
331 def _cmp (self, other):
332 if isinstance(other, str):
333 other = LooseVersion(other)
334
335 if self.version == other.version:
336 return 0
337 if self.version < other.version:
338 return -1
339 if self.version > other.version:
340 return 1
341
~~~
How reproducible is this bug?:
100%
Steps to reproduce
- Copy entire RHEL 8.10 ISO DVD and add additional repo called DCROS. Ensure that group name 'rhel-extras' is set for all packages provided by this repo in comps.xml
- Mention the repo as group "@rhel-extras" in %packages section of kickstart script
--------------------
%packages
@^minimal-environment
@debugging
@development
@legacy-unix
@rhel-extras <--- This is this DCROS repo
@security-tools
@system-tools
glibc.i686
glibc-devel.i686
glibc-headers.i686
kexec-tools
Location of the repo as defined in the kickstart: - Additional repositories that can be used as sources for package installation
repo --name="BaseOS" --baseurl=file:///run/install/repo/BaseOS
repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
repo --name="DCROS" --baseurl=file:///run/install/repo/addons/DCROS/packages
--------------------
- Perform installation with kernel 4.18.0-553.47.1.el8_10.x86_64 included in the repository
This can be easily reproduced outside of all this hassel with directly invoking python :
anaconda-core passes arguments to python3-utils version.py as
other: 4.18.0-553.47.1.el8_10.x86_64
self: 4.18.0-553.el8_10.x86_64
We can pass them over cmdline:
Comparing these works
4.18.0-553.47.1.el8_10.x86_64 > 4.18.0-553.42.1.el8_10.x86_64 : Returns true
~~~
- /usr/bin/python3 -c 'from distutils.version import LooseVersion as V; print(V("4.18.0-553.47.1.el8_10.x86_64") > V("4.18.0-553.42.1.el8_10.x86_64"))'
True
~~~
Comparing these fails
4.18.0-553.47.1.el8_10.x86_64 > 4.18.0-553.el8_10.x86_64
~~~
- /usr/bin/python3 -c 'from distutils.version import LooseVersion as V; print(V("4.18.0-553.47.1.el8_10.x86_64") > V("4.18.0-553.el8_10.x86_64"))'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib64/python3.6/distutils/version.py", line 64, in _gt_
c = self._cmp(other)
File "/usr/lib64/python3.6/distutils/version.py", line 337, in _cmp
if self.version < other.version:
TypeError: '<' not supported between instances of 'int' and 'str'
~~~Expected results
Comparing version should not fail with traceback
4.18.0-553.47.1.el8_10.x86_64 > 4.18.0-553.el8_10.x86_64
Actual results
~~~
installing boot loader
17:39:11,499 INF installation: Queue started: Bootloader installation (7/17)
17:39:11,499 INF installation: Task started: Configure the bootloader (12/44)
17:39:11,613 INF threading: Thread Failed: AnaInstallThread (140606170601216)
17:39:11,613 DBG exception: running handleException
17:39:11,615 CRT exception: Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/pyanaconda/threading.py", line 280, in run
threading.Thread.run(self)
File "/usr/lib64/python3.6/threading.py", line 885, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib64/python3.6/site-packages/pyanaconda/installation.py", line 406, in run_installation
queue.start()
File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 311, in start
item.start()
File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 311, in start
item.start()
File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 311, in start
item.start()
File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 490, in start
self.run_task()
File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 456, in run_task
self._task(*self._task_args, **self._task_kwargs)
File "/usr/lib64/python3.6/site-packages/pyanaconda/installation.py", line 351, in configure_bootloader
boot_task = bootloader_proxy.ConfigureWithTask(payload.kernel_version_list)
File "/usr/lib64/python3.6/site-packages/pyanaconda/payload/dnf/payload.py", line 2105, in kernel_version_list
return sorted(files, key=functools.cmp_to_key(payload_utils.version_cmp))
File "/usr/lib64/python3.6/site-packages/pyanaconda/payload/utils.py", line 180, in version_cmp
return (first_version > second_version) - (first_version < second_version)
File "/usr/lib64/python3.6/distutils/version.py", line 64, in _gt_
c = self._cmp(other)
File "/usr/lib64/python3.6/distutils/version.py", line 337, in _cmp
if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'
>> an unknown error has occurred look at /tmp/anaconda* for more details.
~~~
The problem here is the comparison is happening between
self "str"~"el8_10.x86_64" (or part of it) with other "int" ~ "47.1.el8_10.x86_64" (or part of it)
If we separate out the numeric part before el8_10 and separate the version in 2 variables each and pass them to python LooseVersion, it would not fail.
- is duplicated by
-
RHEL-87355 RHEL 8 Installation fails when version comparison involves base kernel
-
- Closed
-
-
RHEL-87356 RHEL 8 Installation fails when version comparison involves base kernel
-
- Closed
-
-
RHEL-87357 RHEL 8 Installation fails when version comparison involves base kernel
-
- Closed
-
- links to
-
RHBA-2025:150038
anaconda update