Python Plugin Crash

Python and python framework

Moderator: leecollings

Post Reply
pipiche
Posts: 2015
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Python Plugin Crash

Post by pipiche »

Domoticz 2022.1 (build 14257)

I'm getting this stack trace mainly when stop/starting a plugin



pp.zip
(5.88 KiB) Downloaded 33 times
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
pipiche
Posts: 2015
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Re: Python Plugin Crash

Post by pipiche »

same crash with Domoticz 2022.1 (build 14285)
pp.zip
(6.36 KiB) Downloaded 33 times
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
smailhop
Posts: 1
Joined: Saturday 19 March 2022 21:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin Crash

Post by smailhop »

Same problem here when I restart domoticz after installing any plugin it won't start again so I must delete the plugin to get it start again.
I think this problem is related to a python library
User avatar
waltervl
Posts: 5844
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin Crash

Post by waltervl »

If you are on latest beta please report your issue in this topic with the requested details viewtopic.php?t=38086
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin Crash

Post by Dnpwwo »

The 2 stack dumps show that the 'zigpy-deconz' have 3 or 4 threads running during the plugin shutdown.

Python threads need to all be stopped before leaving onStop otherwise there will be a crash. The Python C API doesn't have a way of detecting or handling this (can I've seen).
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin Crash

Post by Dnpwwo »

I've pushed a change to check (and log) for running threads during stop and wait for around 10 seconds to give them time to stop before continuing.

Sadly the 'threading' library doesn't have a 'kill' or 'stop' API so I can't do much about that.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
pipiche
Posts: 2015
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Re: Python Plugin Crash

Post by pipiche »

Thanks I’ll check the plugin code.


Envoyé de mon iPhone en utilisant Tapatalk
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
pipiche
Posts: 2015
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Re: Python Plugin Crash

Post by pipiche »

I'm now on Domoticz 2022.1 build 14289 and get crash when having the plugin running.
This looks to happen when I'm doing a http request from a web browser to a plugin webserver thread. This problem was not existing with a prior Domoticz version I was running
crash.log.zip
(8.42 KiB) Downloaded 37 times
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest