SUSE Support

Here When You Need Us

The salt-api service fails to start with an error: AttributeError: module 'importlib_metadata' has no attribute 'version'

This document (000021219) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Manager 4.3.7

Situation

The salt-api service fails to start with:
 
Sep 27 09:58:31 susemanager salt-api[10577]:     import salt.config
Sep 27 09:58:31 susemanager salt-api[10577]:   File "/usr/lib/python3.6/site-packages/salt/config/__init__.py", line 22, in <module>
Sep 27 09:58:31 susemanager salt-api[10577]:     import salt.utils.network
Sep 27 09:58:31 susemanager salt-api[10577]:   File "/usr/lib/python3.6/site-packages/salt/utils/network.py", line 26, in <module>
Sep 27 09:58:31 susemanager salt-api[10577]:     from salt._compat import ipaddress
Sep 27 09:58:31 susemanager salt-api[10577]:   File "/usr/lib/python3.6/site-packages/salt/_compat.py", line 20, in <module>
Sep 27 09:58:31 susemanager salt-api[10577]:     for part in importlib_metadata.version("importlib_metadata").split(".")
Sep 27 09:58:31 susemanager salt-api[10577]: AttributeError: module 'importlib_metadata' has no attribute 'version'
Sep 27 09:58:31 susemanager systemd[1]: salt-api.service: Main process exited, code=exited, status=1/FAILURE
Sep 27 09:58:31 susemanager systemd[1]: salt-api.service: Failed with result 'exit-code'.

Resolution

Un-install the pip installed python module "importlib-metadata" and install the package version "python3-importlib-metadata":
 
pip uninstall importlib-metadata
zypper in python3-importlib-metadata

Cause

Refrain from installing pip (Python Package Installer) modules on a SUSE Manager server as this can result in version mismatches resulting in attribute errors.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021219
  • Creation Date: 11-Oct-2023
  • Modified Date:09-Jan-2024
    • SUSE Manager Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.