Non integer values in LooseVersion('stable/1.0.0')

Bug #1982552 reported by Amol Kahat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Confirmed
Medium
Amol Kahat

Bug Description

Ansible galaxy not able to recognize stable/1.0.0 version

Actual Error
============
Starting galaxy collection install process
2022-07-22 03:32:03.698896 | primary | ERROR! Unexpected Exception, this is probably a bug: Non integer values in LooseVersion ('stable/1.0.0')
2022-07-22 03:32:03.698979 | primary | to see the full traceback, use -vvv
2022-07-22 07:32:04.061132 | primary | ERROR
2022-07-22 07:32:04.061355 | primary | {
2022-07-22 07:32:04.061400 | primary | "delta": "0:01:54.886069",
2022-07-22 07:32:04.061426 | primary | "end": "2022-07-22 03:32:03.781466",
2022-07-22 07:32:04.061448 | primary | "msg": "non-zero return code",
2022-07-22 07:32:04.061478 | primary | "rc": 250,
2022-07-22 07:32:04.061498 | primary | "start": "2022-07-22 03:30:08.895397"
2022-07-22 07:32:04.061518 | primary | }

Amol Kahat (amolkahat)
Changed in tripleo:
status: New → Incomplete
description: updated
Revision history for this message
Rabi Mishra (rabi) wrote :
Revision history for this message
Amol Kahat (amolkahat) wrote :

Thanks Rabi for comment.

Currently we are not seeing this issue in CI. Marking this bug as Invalid.

Changed in tripleo:
status: Incomplete → Invalid
Revision history for this message
Jiri Podivin (jpodivin) wrote :

For future record. This is caused by Ansible attempting to convert LooseVersion into semantic version using 'SemanticVersion.from_loose_version' method[0], which is used in ansible galaxy code[1][2].

This approach works if, and only if, prefix of the version string, delimited by either '+' or '-', consists only of elements that can be cast into 'int'.

Otherwise it fails with the error we have seen. Unfortunately, LooseVersion class technically does allow other characters to be used in the string. So the error won't manifest until Ansible attempts the conversion.

[0]https://github.com/ansible/ansible/blob/devel/lib/ansible/utils/version.py#L151
[1]https://github.com/ansible/ansible/blob/devel/lib/ansible/galaxy/dependency_resolution/versioning.py#L63
[2]https://github.com/ansible/ansible/blob/devel/lib/ansible/galaxy/dependency_resolution/providers.py#L45

Amol Kahat (amolkahat)
Changed in tripleo:
status: Invalid → Confirmed
assignee: nobody → Amol Kahat (amolkahat)
milestone: none → yoga-1
Revision history for this message
Amol Kahat (amolkahat) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.