Coder Social home page Coder Social logo

Comments (5)

Taraman17 avatar Taraman17 commented on June 23, 2024

The debug log from pymee shows (I truncated the {'all': message, since it may contain personal information):

2023-06-26 16:58:04.909 ERROR (MainThread) [pymee] An error occurred: invalid state
2023-06-26 16:58:09.930 INFO (MainThread) [pymee] Opening websocket...
2023-06-26 16:58:09.957 INFO (MainThread) [pymee] Connection to websocket successfull
2023-06-26 16:58:09.960 DEBUG (MainThread) [pymee] PING!
2023-06-26 16:58:10.078 DEBUG (MainThread) [pymee] {'all': {'users': [{'id': 1, 'username': ...
2023-06-26 16:58:10.149 ERROR (MainThread) [pymee] An error occurred: 'list' object is not an iterator
2023-06-26 16:58:15.154 INFO (MainThread) [pymee] Opening websocket...
2023-06-26 16:58:15.189 INFO (MainThread) [pymee] Connection to websocket successfull
2023-06-26 16:58:15.191 DEBUG (MainThread) [pymee] PING!
2023-06-26 16:58:15.323 DEBUG (MainThread) [pymee] {'all': {'users': [{'id': 1, 'username': ...
2023-06-26 16:58:15.399 ERROR (MainThread) [pymee] An error occurred: 'list' object is not an iterator
2023-06-26 16:58:23.831 INFO (MainThread) [pymee] Opening websocket...
2023-06-26 16:58:24.236 INFO (MainThread) [pymee] Connection to websocket successfull
2023-06-26 16:58:24.245 DEBUG (MainThread) [pymee] PING!

In the received message the "options" collections look all correct and in other cases do not lead to this error.
The "invalid state" error followed by a new connection to websockets makes me think it might be related to frequent disconnects from Homee I get in Homeassistant.
unfortunately I'm not able to reprocduce this error in my devcontainer where I could debug.

A first idea to cope with this error is to change model.py to following:

import logging

_LOGGER = logging.getLogger(__name__)

class HomeeAttributeOptions:
    def __init__(self, attributeOptions):
        try:
            iterator = iter(attributeOptions)
        except TypeError:
            _LOGGER.warn("options are not Iterable: " + attributeOptions)
            raise TypeError("options are not Iterable.")
        else:
            self._data = attributeOptions

from pymee.

Taraman17 avatar Taraman17 commented on June 23, 2024

After downgrading to pymee 1.7.1, the error still occurs - so it does not seem to be linked to the latest additions.

from pymee.

Taraman17 avatar Taraman17 commented on June 23, 2024

I'm starting to get another error at the same time, the above happens:

2023-07-01 13:27:23.723 ERROR (MainThread) [homeassistant] Error doing job: Error on transport creation for incoming connection
Traceback (most recent call last):
File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 222, in _accept_connection2
await waiter
File "/usr/local/lib/python3.11/asyncio/sslproto.py", line 575, in _on_handshake_complete
raise handshake_exc
ConnectionResetError

from pymee.

thargy avatar thargy commented on June 23, 2024

I have the same issue, in that my log viewer is getting spammed with
ERROR (MainThread) [pymee] An error occurred: 'list' object is not an iterator

from pymee.

Taraman17 avatar Taraman17 commented on June 23, 2024

I was able to narrow it down to the

_update_or_create_relationships(self, data: dict)

function.

With try/except and logging I got:
2023-11-03 22:37:56.451 WARNING (MainThread) [pymee] Could not iterate over relationships: [{'id': 1, 'group_id': 1, 'node_id': 3, 'homeegram_id': 0, 'order': 0}, {'id': 2, 'group_id': 1, 'node_id': 9, 'homeegram_id': 0, 'order': 0}]
Most interestingly, the data which is logged IS iterable, so I don't know why it throws on the for/in call.
Will have to investigate further.

With the upcoming update however, the exception will be caught and at least the connection stays intact.
Not sure yet which side-effects it may have, that this update of the relationships is not done then.

from pymee.

Related Issues (2)

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.