Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem after HA 2023.9.0 upgrade [Bug] #304

Open
PetrP2B opened this issue Sep 14, 2023 · 5 comments
Open

Problem after HA 2023.9.0 upgrade [Bug] #304

PetrP2B opened this issue Sep 14, 2023 · 5 comments
Labels
bug Something isn't working planned To be implemented in future release

Comments

@PetrP2B
Copy link

PetrP2B commented Sep 14, 2023

When switching both WLAN1 and WLAN2 enable/disable it ends up with this error. If I switch one, wait for a response and then switch next one, everything seems fine. In HA version 2023.8 everything worked fine.

HA: 2023.9.2
component Mikrotik router: master version
Mikrotik version: 7.11.2

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/mikrotik_router/mikrotikapi.py:228
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 14:55:44 (1 occurrences)
Last logged: 14:55:44

[140554354164160] timed out
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/homeassistant/init.py", line 130, in async_handle_turn_service
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 898, in entity_service_call
task.result() # pop exception if have
^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1197, in async_request_call
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/mikrotik_router/switch.py", line 155, in async_turn_on
self.coordinator.set_value(path, param, value, mod_param, False)
File "/config/custom_components/mikrotik_router/coordinator.py", line 440, in set_value
return self.api.set_value(path, param, value, mod_param, mod_value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mikrotik_router/mikrotikapi.py", line 228, in set_value
for tmp in response:
File "/usr/local/lib/python3.11/site-packages/librouteros/api.py", line 107, in iter
yield from self('print')
File "/usr/local/lib/python3.11/site-packages/librouteros/api.py", line 110, in call
yield from self.api(
File "/usr/local/lib/python3.11/site-packages/librouteros/api.py", line 35, in call
yield from self.readResponse()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/librouteros/api.py", line 67, in readResponse
reply_word, words = self.readSentence()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/librouteros/api.py", line 53, in readSentence
reply_word, words = self.protocol.readSentence()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/librouteros/protocol.py", line 187, in readSentence
sentence = tuple(word for word in iter(self.readWord, ''))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/librouteros/protocol.py", line 187, in
sentence = tuple(word for word in iter(self.readWord, ''))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Logger: custom_components.mikrotik_router.mikrotikapi
Source: custom_components/mikrotik_router/mikrotikapi.py:183
Integration: Mikrotik Router (documentation, issues)
First occurred: 14:56:13 (1 occurrences)
Last logged: 14:56:13

Mikrotik Reconnected to 192.168.2.6^^^
File "/usr/local/lib/python3.11/site-packages/librouteros/protocol.py", line 203, in readWord
word = self.transport.read(length)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/librouteros/connections.py", line 25, in read
data += self.sock.recv((length - len(data)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: timed out

@PetrP2B PetrP2B added the bug Something isn't working label Sep 14, 2023
@tomaae tomaae added the planned To be implemented in future release label Sep 14, 2023
@tomaae
Copy link
Owner

tomaae commented Sep 18, 2023

I have to inquire HA dev with this. Cant figure out how/if new coordinator handles conflict with switch queries.

@tomaae
Copy link
Owner

tomaae commented Sep 20, 2023

So coordinator does not handle outgoing conflits at all, will have to come up with something custom.

@PetrP2B
Copy link
Author

PetrP2B commented Sep 20, 2023

It must have something to do with the HA update to 2023.9 because it worked reliably before that.

@tomaae
Copy link
Owner

tomaae commented Sep 20, 2023

not really, its related to integration being rewritten for HA coordinator

@riddley riddley mentioned this issue Mar 2, 2024
@fusionstream
Copy link

Following

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working planned To be implemented in future release
Projects
None yet
Development

No branches or pull requests

3 participants