Caracal Magnum: magnum-api-wsgi fails to start because of a problem retrieving the version
Hi, Moving forward with my current upgrades, I tried to upgrade our preprod Magnum to Caracal. Unfortunately, every components using the Magnum module fails with: ---- File "/usr/bin/magnum-api-wsgi", line 52, in <module> application = build_wsgi_app() File "/usr/lib/python3.9/site-packages/magnum/api/app.py", line 74, in build_wsgi_app service.prepare_service(sys.argv) File "/usr/lib/python3.9/site-packages/magnum/common/service.py", line 27, in prepare_service config.parse_args(argv) File "/usr/lib/python3.9/site-packages/magnum/common/config.py", line 32, in parse_args version=version.version_info.release_string(), File "/usr/lib/python3.9/site-packages/pbr/version.py", line 490, in release_string return self.semantic_version().release_string() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 498, in semantic_version self._semantic = self._get_version_from_importlib_metadata() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 483, in _get_version_from_importlib_metadata return SemanticVersion.from_pip_string(result_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 156, in from_pip_string return klass._from_pip_string_unsafe(version_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 163, in _from_pip_string_unsafe version_string = version_string.lstrip('vV') AttributeError: 'NoneType' object has no attribute 'lstrip' ---- It also affects magnum-db-manage where the traceback is litle bit different but the exception happens at the same place so I guess it is a common cause: ------ File "/usr/bin/magnum-db-manage", line 5, in <module> from magnum.cmd.db_manage import main File "/usr/lib/python3.9/site-packages/magnum/__init__.py", line 18, in <module> __version__ = pbr.version.VersionInfo( File "/usr/lib/python3.9/site-packages/pbr/version.py", line 505, in version_string return self.semantic_version().brief_string() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 498, in semantic_version self._semantic = self._get_version_from_importlib_metadata() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 483, in _get_version_from_importlib_metadata return SemanticVersion.from_pip_string(result_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 156, in from_pip_string return klass._from_pip_string_unsafe(version_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 163, in _from_pip_string_unsafe version_string = version_string.lstrip('vV') AttributeError: 'NoneType' object has no attribute 'lstrip' ------ For magnum-db-manage a workaround is to comment the __version__ line in __init__.but it doesn't help for the API. I wanted to check in the Magnum release notes if I missed some requirements but unfortunately they are not linked from https://releases.openstack.org/caracal/#caracal-magnum and I was not able to locate them elsewhere... Thanks in advance for any help/hint. Best regards, Michel
Hi, I have not seen any answer to this despite I have the feeling others may have seen this issue... Our installation (RDO-based) is very standard as far as I can tell... We deployed the last RPMs from the RDO repository as of yesterday. Best regards, Michel Le 06/06/2024 à 15:35, Michel Jouvin a écrit :
Hi,
Moving forward with my current upgrades, I tried to upgrade our preprod Magnum to Caracal. Unfortunately, every components using the Magnum module fails with:
----
File "/usr/bin/magnum-api-wsgi", line 52, in <module> application = build_wsgi_app() File "/usr/lib/python3.9/site-packages/magnum/api/app.py", line 74, in build_wsgi_app service.prepare_service(sys.argv) File "/usr/lib/python3.9/site-packages/magnum/common/service.py", line 27, in prepare_service config.parse_args(argv) File "/usr/lib/python3.9/site-packages/magnum/common/config.py", line 32, in parse_args version=version.version_info.release_string(), File "/usr/lib/python3.9/site-packages/pbr/version.py", line 490, in release_string return self.semantic_version().release_string() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 498, in semantic_version self._semantic = self._get_version_from_importlib_metadata() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 483, in _get_version_from_importlib_metadata return SemanticVersion.from_pip_string(result_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 156, in from_pip_string return klass._from_pip_string_unsafe(version_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 163, in _from_pip_string_unsafe version_string = version_string.lstrip('vV') AttributeError: 'NoneType' object has no attribute 'lstrip' ----
It also affects magnum-db-manage where the traceback is litle bit different but the exception happens at the same place so I guess it is a common cause:
------
File "/usr/bin/magnum-db-manage", line 5, in <module> from magnum.cmd.db_manage import main File "/usr/lib/python3.9/site-packages/magnum/__init__.py", line 18, in <module> __version__ = pbr.version.VersionInfo( File "/usr/lib/python3.9/site-packages/pbr/version.py", line 505, in version_string return self.semantic_version().brief_string() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 498, in semantic_version self._semantic = self._get_version_from_importlib_metadata() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 483, in _get_version_from_importlib_metadata return SemanticVersion.from_pip_string(result_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 156, in from_pip_string return klass._from_pip_string_unsafe(version_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 163, in _from_pip_string_unsafe version_string = version_string.lstrip('vV') AttributeError: 'NoneType' object has no attribute 'lstrip'
------
For magnum-db-manage a workaround is to comment the __version__ line in __init__.but it doesn't help for the API.
I wanted to check in the Magnum release notes if I missed some requirements but unfortunately they are not linked from https://releases.openstack.org/caracal/#caracal-magnum and I was not able to locate them elsewhere...
Thanks in advance for any help/hint.
Best regards,
Michel
Hi, I found the time to have a deeper look to this problem. The problem seems to come from module importlib.metadata provided by python3-importlib-metadata-6.8.0-1.el9s.noarch (that has been installed from RDO repository mirror, the last version today). Because of problem in this module, the returned value for magnum from importlib.metadata.distribution() called by pbr.version.VersionInfo() (itself called by magnum/__init__ as shown by the traceback given in my first message) is None instead of a string. The following code (copied from pbr.version) allows to demonstrate the problem: ------------ #!/usr/bin/python from importlib import metadata as importlib_metadata for package in ['magnum']: distribution = importlib_metadata.distribution(package) result_string = distribution.version print("package", package, "result_string=", result_string) ------------ If run on an Antelope machine it works fine. If run on a Caracal machine it returns None. Any thought? Michel Le 07/06/2024 à 11:28, Michel Jouvin a écrit :
Hi,
I have not seen any answer to this despite I have the feeling others may have seen this issue... Our installation (RDO-based) is very standard as far as I can tell... We deployed the last RPMs from the RDO repository as of yesterday.
Best regards,
Michel
Le 06/06/2024 à 15:35, Michel Jouvin a écrit :
Hi,
Moving forward with my current upgrades, I tried to upgrade our preprod Magnum to Caracal. Unfortunately, every components using the Magnum module fails with:
----
File "/usr/bin/magnum-api-wsgi", line 52, in <module> application = build_wsgi_app() File "/usr/lib/python3.9/site-packages/magnum/api/app.py", line 74, in build_wsgi_app service.prepare_service(sys.argv) File "/usr/lib/python3.9/site-packages/magnum/common/service.py", line 27, in prepare_service config.parse_args(argv) File "/usr/lib/python3.9/site-packages/magnum/common/config.py", line 32, in parse_args version=version.version_info.release_string(), File "/usr/lib/python3.9/site-packages/pbr/version.py", line 490, in release_string return self.semantic_version().release_string() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 498, in semantic_version self._semantic = self._get_version_from_importlib_metadata() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 483, in _get_version_from_importlib_metadata return SemanticVersion.from_pip_string(result_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 156, in from_pip_string return klass._from_pip_string_unsafe(version_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 163, in _from_pip_string_unsafe version_string = version_string.lstrip('vV') AttributeError: 'NoneType' object has no attribute 'lstrip' ----
It also affects magnum-db-manage where the traceback is litle bit different but the exception happens at the same place so I guess it is a common cause:
------
File "/usr/bin/magnum-db-manage", line 5, in <module> from magnum.cmd.db_manage import main File "/usr/lib/python3.9/site-packages/magnum/__init__.py", line 18, in <module> __version__ = pbr.version.VersionInfo( File "/usr/lib/python3.9/site-packages/pbr/version.py", line 505, in version_string return self.semantic_version().brief_string() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 498, in semantic_version self._semantic = self._get_version_from_importlib_metadata() File "/usr/lib/python3.9/site-packages/pbr/version.py", line 483, in _get_version_from_importlib_metadata return SemanticVersion.from_pip_string(result_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 156, in from_pip_string return klass._from_pip_string_unsafe(version_string) File "/usr/lib/python3.9/site-packages/pbr/version.py", line 163, in _from_pip_string_unsafe version_string = version_string.lstrip('vV') AttributeError: 'NoneType' object has no attribute 'lstrip'
------
For magnum-db-manage a workaround is to comment the __version__ line in __init__.but it doesn't help for the API.
I wanted to check in the Magnum release notes if I missed some requirements but unfortunately they are not linked from https://releases.openstack.org/caracal/#caracal-magnum and I was not able to locate them elsewhere...
Thanks in advance for any help/hint.
Best regards,
Michel
participants (1)
-
Michel Jouvin