Strange problem after upgrading to Debian 11 (Bullseye) and Python 3.9

Python and python framework

Moderator: leecollings

Post Reply
EscApe
Posts: 539
Joined: Thursday 02 April 2015 8:46
Target OS: Linux
Domoticz version: 2020+
Location: The Netherlands
Contact:

Strange problem after upgrading to Debian 11 (Bullseye) and Python 3.9

Post by EscApe »

My plugin (https://github.com/d-EScape/Domoticz_iDetect) was working fine in Debian 10 (Buster) and Python 3.7, but throws lots of (different, but mostly different types of timeouts) ssh exceptions after upgrading to Debian 11, which includes Python 3.9. After a while the exceptions would slow down Domoticz, making it almost completely unresponsive and sometimes crash. The ssh communication in the plugin is using paramiko.

The initialization seemed to run fine, including some ssh executions(!) But most of the time the exceptions started occurring shortly after. Experimenting with longer timeouts and intervals did not make any difference. But I noticed that the exceptions only occurred after (re)starting Domoticz. Not when the plugin was restarted from within Domoticz. So for now I build a startup delay into the plugin. The real onStart (which is now renamed) will run after some heartbeats.That seems to avoid the exceptions (it has now been running for about an hour, but would throw exceptions within minutes without the delay).

Has anyone seen this kind of behavior before? What could possibly make the plugin fail this way with the same Domoticz version, but a different Debian and/or Python version? What could cause a plugin to fail on a Domoticz (re)start, but not when only restarting the plugin? It could be that Domoticz just is not completely ready, but that would not explain why the exceptions do not occur immediately (with the fist ssh connections). Does the Python 3.7 to 3.9 transition introduce different startup behavior for the plugin framework?

Any help in finding the true cause of this issue and -preferably- a solution would be most welcome!

@Dnpwwo: hope you also read this and have some insights
pipiche
Posts: 2034
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Re: Strange problem after upgrading to Debian 11 (Bullseye) and Python 3.9

Post by pipiche »

Did you try to rebuild domoticz with the new libs ?


Envoyé de mon iPhone en utilisant Tapatalk
EscApe
Posts: 539
Joined: Thursday 02 April 2015 8:46
Target OS: Linux
Domoticz version: 2020+
Location: The Netherlands
Contact:

Re: Strange problem after upgrading to Debian 11 (Bullseye) and Python 3.9

Post by EscApe »

pipiche wrote: Monday 16 August 2021 14:15 Did you try to rebuild domoticz with the new libs ?
Hi pipiche,

I am running the installable version and no longer compile from source. Will give it a try if there are no other suggestions and I have some time to kill.
Thanks for your suggestion!
EscApe
Posts: 539
Joined: Thursday 02 April 2015 8:46
Target OS: Linux
Domoticz version: 2020+
Location: The Netherlands
Contact:

Re: Strange problem after upgrading to Debian 11 (Bullseye) and Python 3.9

Post by EscApe »

After lots of experimenting it looks like some python plugins are interfering with each other using Debian 11 and python 3.9.

Among the interfering plugins are some of my own making: https://github.com/d-EScape/Domoticz_iDetect and https://github.com/d-EScape/MotionShades-for-Domoticz. This is the interference I can reproduce:
- Independently they both work fine
- If I start (or update) iDetect after motion blinds then the motionblinds will still control the blinds, but the incoming multicast status updates do no longer reach the plugin
- If I start the motionblinds plugin after iDetect the situation in my original post occur. That is why the startup delay seemed to solve it (but turned out to have soms side effects for motionblinds).

Other plugins that also turned out to interfere (without obvious side effects for themselves) where a small plugin I wrote to get grocery delivery times from "PicNic" and this one I found at domticz: http://www.domoticz.com/wiki/plugins/NUT_UPS.html

I am still looking for the differences introduced bij Debian 11 and python 3.9 that might cause this. Are there any runtime limits/parameters that are new or have a different default?

These plugins use other modules for communication and not the connection from the plugin framework. I do not know if that has anything to do with it, but it might. Since this is starting to look like a communication (limitation) issue.
Post Reply