Comments (14)
Did you get this error again?
from smarthome.
Haven't tried with latest version but yes this error came up multiple times. I think esp. when you restart shng several times within a shorter time period, e.g. within 20-30 seconds or so. Not sure.
from smarthome.
Is this issue still relevant?
from smarthome.
Catching the error is trivial (enclosing the thread.start-call in try..except), but I'd like to find out the reason for multiple starts. This might be a timing problem on short interval disconnects and sends or restarts (via adminUI or stopping and starting on the console?)
Also see gitter ;)
from smarthome.
Found 2 occurrences on 2022-02-15, but not anymore since. Always current master version
from smarthome.
Currently can't reproduce the issue with latest develop.. not sure if it's fixed..?
from smarthome.
I am going to close the issue as resolved. If it should happen again, the issue can be reopened.
from smarthome.
It just happened again.. Here is the network log, maybe helpful..?
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.eg.osten_buero.hoehe (plugins.knx_127.0.0.1:6720) autoconnecting on send attempt, message is bytearray(b"\x00\x06\x00\'\x11\x12\x00\x00") -- (network.py:send:695)
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.og.sueden_schiebetuere.hoehe (plugins.knx_127.0.0.1:6720) autoconnecting on send attempt, message is bytearray(b"\x00\x06\x00\'\x19&\x00\x00") -- (network.py:send:695)
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.eg.osten_buero.hoehe Starting connect to 127.0.0.1:6720 -- (network.py:connect:658)
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.og.sueden_schiebetuere.hoehe Starting connect to 127.0.0.1:6720 -- (network.py:connect:658)
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.eg.osten_buero.hoehe connect() to 127.0.0.1:6720: self.__running=False, self.__connect_thread.is_alive()=False -- (network.py:connect:662)
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.og.sueden_schiebetuere.hoehe connect() to 127.0.0.1:6720: self.__running=False, self.__connect_thread.is_alive()=False -- (network.py:connect:662)
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.eg.osten_buero.hoehe connect() to 127.0.0.1:6720: calling __connect_thread.start() -- (network.py:connect:664)
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.og.sueden_schiebetuere.hoehe connect() to 127.0.0.1:6720: calling __connect_thread.start() -- (network.py:connect:664)
Mär 29 22:28:25 CEST DEBUG lib.network TCP_Connect (plugins.knx_127.0.0.1:6720) (plugins.knx_127.0.0.1:6720) starting connection cycle -- (network.py:_connect_thread_worker:743)
Mär 29 22:28:25 CEST DEBUG lib.network KNX poll jalousien.eg.osten_buero.hoehe leaving connect() to 127.0.0.1:6720 -- (network.py:connect:666)
Mär 29 22:28:25 CEST DEBUG lib.network TCP_Connect (plugins.knx_127.0.0.1:6720) (plugins.knx_127.0.0.1:6720) connecting using TCP/IPv4 with autoreconnect -- (network.py:_connect:783)
Mär 29 22:28:25 CEST INFO lib.network TCP_Connect (plugins.knx_127.0.0.1:6720) (plugins.knx_127.0.0.1:6720) connected -- (network.py:_connect:792)
Error itself:
Mär 29 22:28:25 ERROR KNX poll jalousien.og.sueden_schiebetuere.hoehe Method KNX poll jalousien.og.sueden_schiebetuere.hoehe exception: threads can only be started once
Traceback (most recent call last):
File "/usr/local/smarthome/lib/scheduler.py", line 692, in _task
obj(**value)
File "/usr/local/smarthome/plugins/knx/__init__.py", line 228, in _poll
self.groupread(kwargs['ga'])
File "/usr/local/smarthome/plugins/knx/__init__.py", line 219, in groupread
self._send(pkt)
File "/usr/local/smarthome/plugins/knx/__init__.py", line 167, in _send
self._client.send(send)
File "/usr/local/smarthome/lib/network.py", line 696, in send
self.connect()
File "/usr/local/smarthome/lib/network.py", line 665, in connect
self.__connect_thread.start()
File "/usr/lib/python3.9/threading.py", line 869, in start
raise RuntimeError("threads can only be started once")
RuntimeError: threads can only be started once
KNX Busmonitor shows that no commands were sent or received at that time
Mär 29 22:26:12 - Nutze Feiertage für Land 'AT', Provinz '9', benutzerdefinierte(r) Feiertag(e) nicht definiert;
Mär 29 22:28:33 ;1.1.32;0/6/4;False;
from smarthome.
Its plain to see that two KNX poll requests are submitted at "the same time" (at least inside the same second as the whole "incident") - both requests initiate autoreconnect, trigger connect, trigger connection_cycle_start.
Maybe switching from a locking flag to using "real" locks might solve this, maybe just try/excepting the thread start call might achieve similar results.
I'll take another look into lib.network.
(I'm wondering why the connection is dropped in the first place...?)
from smarthome.
Proposed fix #543
from smarthome.
As long as no further negative feedback is given, I'll close this as resolved.
from smarthome.
Hm, didn't we have to revert the fix? Don't think this issue is really fixed.. Let me know, we close it again if I'm wrong ;)
from smarthome.
those who (still) have the issue, please test if the fix works for you
from smarthome.
with the latest commit I think this issue is gone..let's test some more days/weeks and then close. Thx
from smarthome.
Related Issues (20)
- HTTP Module: improve handling of page length and responsive design HOT 2
- CherryPy ValueError on restart HOT 2
- cache value not converted to current item type
- Issues with (re)loading logics from the editor page of the admin gui HOT 7
- structs not checked for wrong configurations? HOT 1
- Issue with smartdeviceplugin with UTF-8 response HOT 1
- Requirements von Logiken und Userfunctions installieren beim Start? HOT 7
- Websocket crashed HOT 4
- Vorschlag zum besseren Handling von Items mit Datentyp 'dict' oder 'list' HOT 25
- Websocket Exceptions HOT 4
- struct names are applied to items including the struct
- Visu subscription of a memory log activates sending of env.core.log HOT 5
- smarthome/doc/user/source/beispiele/eval.rst Beispiel "Enumeration über Liste" funktioniert nicht HOT 1
- Log configuration: allow placeholders for filename and rotate correctly HOT 1
- Delay in scenes HOT 4
- Problem when Item has the same name as a class Item method HOT 5
- Http module cannot bind on all interfaces
- Incompability to paho-mqtt-2.0.0 HOT 1
- Usage of logging.default.yaml HOT 7
- Problem bei max python Version zum Start? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarthome.