Giter VIP home page Giter VIP logo

Comments (4)

legrego avatar legrego commented on July 25, 2024

I agree with you -- based on the error message, it looks like HA failed to download the elasticsearch client dependency. I'm on HA 0.74 right now, but let me test on a fresh install of 0.77 to see if I can reproduce.

Sorry to ask the obvious, but have you tried restarting HA to see if that fixes the problem?

Otherwise, are you able to check if the elasticsearch package is installed by HA? (see https://developers.home-assistant.io/docs/en/creating_component_deps_and_reqs.html#requirements)

from homeassistant-elasticsearch.

MrBoggi avatar MrBoggi commented on July 25, 2024

I think we just saw a typical example of PEBKAC here. So now it loads as it should but I see the following error now:

2018-09-02 07:48:00 ERROR (MainThread) [custom_components.elastic] Error publishing documents to Elasticsearch: ({'domain': 'zwave', 'entity_id': 'e2_kontor_varme_gulvtermostat', 'attributes': {'node_id': 19, 'node_name': 'Kontor Gulvvarme', 'manufacturer_name': 'ThermoFloor AS', 'product_name': 'Heatit Thermostat TF 021', 'query_stage': 'Complete', 'is_awake': True, 'is_ready': True, 'is_failed': False, 'is_info_received': True, 'max_baud_rate': 40000, 'is_zwave_plus': True, 'capabilities': {'listening', 'zwave_plus', 'beaming', 'routing'}, 'neighbors': {128, 1, 8, 9, 10, 13, 21, 24, 27, 28, 29, 36, 38, 73, 84, 111, 118, 119, 120, 121, 122, 125}, 'sentCnt': 12, 'sentFailed': 0, 'retries': 0, 'receivedCnt': 29, 'receivedDups': 2, 'receivedUnsolicited': 22, 'sentTS': '2018-09-02 07:32:26:942 ', 'receivedTS': '2018-09-02 07:47:02:627 ', 'lastRequestRTT': 119, 'averageRequestRTT': 80, 'lastResponseRTT': 134, 'averageResponseRTT': 100, 'friendly_name': 'Kontor Gulvvarme'}, 'time': datetime.datetime(2018, 9, 2, 5, 47, 2, 739831, tzinfo=), 'value': 'ready'}, TypeError("Unable to serialize {'listening', 'zwave_plus', 'beaming', 'routing'} (type: <class 'set'>)",))

Traceback (most recent call last):

File "/config/deps/lib/python3.6/site-packages/elasticsearch/serializer.py", line 52, in dumps

separators=(',', ':'),

File "/usr/local/lib/python3.6/site-packages/simplejson/init.py", line 399, in dumps

**kw).encode(obj)

File "/usr/local/lib/python3.6/site-packages/simplejson/encoder.py", line 296, in encode

chunks = self.iterencode(o, _one_shot=True)

File "/usr/local/lib/python3.6/site-packages/simplejson/encoder.py", line 378, in iterencode

return _iterencode(o, 0)

File "/config/deps/lib/python3.6/site-packages/elasticsearch/serializer.py", line 34, in default

raise TypeError("Unable to serialize %r (type: %s)" % (data, type(data)))

TypeError: Unable to serialize {'listening', 'zwave_plus', 'beaming', 'routing'} (type: <class 'set'>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/config/custom_components/elastic.py", line 205, in do_publish

bulk_response = bulk(self._gateway.get_client(), actions)

File "/config/deps/lib/python3.6/site-packages/elasticsearch/helpers/init.py", line 257, in bulk

for ok, item in streaming_bulk(client, actions, *args, **kwargs):

File "/config/deps/lib/python3.6/site-packages/elasticsearch/helpers/init.py", line 180, in streaming_bulk

client.transport.serializer):

File "/config/deps/lib/python3.6/site-packages/elasticsearch/helpers/init.py", line 64, in _chunk_actions

data = serializer.dumps(data)

File "/config/deps/lib/python3.6/site-packages/elasticsearch/serializer.py", line 55, in dumps

raise SerializationError(data, e)

elasticsearch.exceptions.SerializationError: ({'domain': 'zwave', 'entity_id': 'e2_kontor_varme_gulvtermostat', 'attributes': {'node_id': 19, 'node_name': 'Kontor Gulvvarme', 'manufacturer_name': 'ThermoFloor AS', 'product_name': 'Heatit Thermostat TF 021', 'query_stage': 'Complete', 'is_awake': True, 'is_ready': True, 'is_failed': False, 'is_info_received': True, 'max_baud_rate': 40000, 'is_zwave_plus': True, 'capabilities': {'listening', 'zwave_plus', 'beaming', 'routing'}, 'neighbors': {128, 1, 8, 9, 10, 13, 21, 24, 27, 28, 29, 36, 38, 73, 84, 111, 118, 119, 120, 121, 122, 125}, 'sentCnt': 12, 'sentFailed': 0, 'retries': 0, 'receivedCnt': 29, 'receivedDups': 2, 'receivedUnsolicited': 22, 'sentTS': '2018-09-02 07:32:26:942 ', 'receivedTS': '2018-09-02 07:47:02:627 ', 'lastRequestRTT': 119, 'averageRequestRTT': 80, 'lastResponseRTT': 134, 'averageResponseRTT': 100, 'friendly_name': 'Kontor Gulvvarme'}, 'time': datetime.datetime(2018, 9, 2, 5, 47, 2, 739831, tzinfo=), 'value': 'ready'}, TypeError("Unable to serialize {'listening', 'zwave_plus', 'beaming', 'routing'} (type: <class 'set'>)",))

It creates indexes as it should I think because I see data in ELK:
image

from homeassistant-elasticsearch.

legrego avatar legrego commented on July 25, 2024

Thanks for the followup @MrBoggi!

It looks like you've found a bug -- I am not serializing python sets correctly. I've opened #26 to track this.

from homeassistant-elasticsearch.

legrego avatar legrego commented on July 25, 2024

Closing as the original issue was resolved 👍

from homeassistant-elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.