Skip to content

[v0.7] Elasticsearch Python client is incompatible with latest HA Version #398

@mike12806

Description

@mike12806

Environment
Home-Assistant version: 2024.12.0
Elasticsearch version: 8.16.1

Relevant configuration.yml settings:

# Do not include your Elasticsearch URL, credentials, or any other sensitive information
elastic:
  ...

Describe the bug

Screenshot 2024-12-05 at 12 04 13 AM

        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1085, in _get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.elasticsearch

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1074, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/elasticsearch/__init__.py", line 43, in <module>
    from .es_integration import ElasticIntegration
  File "/config/custom_components/elasticsearch/es_integration.py", line 11, in <module>
    from .es_doc_publisher import DocumentPublisher
  File "/config/custom_components/elasticsearch/es_doc_publisher.py", line 15, in <module>
    from custom_components.elasticsearch.es_index_manager import IndexManager
  File "/config/custom_components/elasticsearch/es_index_manager.py", line 6, in <module>
    from elasticsearch7 import ElasticsearchException
  File "/usr/local/lib/python3.13/site-packages/elasticsearch7/__init__.py", line 36, in <module>
    from .client import Elasticsearch
  File "/usr/local/lib/python3.13/site-packages/elasticsearch7/client/__init__.py", line 22, in <module>
    from ..transport import Transport, TransportError
  File "/usr/local/lib/python3.13/site-packages/elasticsearch7/transport.py", line 25, in <module>
    from .serializer import JSONSerializer, Deserializer, DEFAULT_SERIALIZERS
  File "/usr/local/lib/python3.13/site-packages/elasticsearch7/serializer.py", line 50, in <module>
    np.float_,
    ^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/numpy/__init__.py", line 400, in __getattr__
    raise AttributeError(
    ...<3 lines>...
    )
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1034, in async_get_component
    self._component_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1026, in async_get_component
    comp = self._get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1085, in _get_component
    raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.elasticsearch�[0m

Expected behavior
A clear and concise description of what you expected to happen.

Expect Elasticsearch integration to start

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions