Page 1 of 2
Stability with Python Plugins
Posted: Tuesday 05 December 2017 20:47
by Noudje
I know that the use of Python Plugins is beta.
But my experience is that after adding a python plugin as hardware, after a couple of hours, Domoticz stops working. When I restart the domoticz service, is works again for a couple of hours, but will stop again.
With Domoticz stopping, I mean that the domoticz web page gives off line, and (lua) scripts are not running. The raspberry pi is still accessible.
I am using jessie with python3 and python3-dev are the latest versions.
Any one with the same experience? Any suggestions how to solve this?
Re: Stability with Python Plugins
Posted: Tuesday 05 December 2017 20:53
by EdwinK
I have the problem that when I add a python plugin (buienrader, circle360) after activating it, there is an error regarding devices. I have to completely remove the plugin and then restarting domoticz to fix it.
Re: Stability with Python Plugins
Posted: Tuesday 05 December 2017 20:58
by Noudje
I didn't see any errors in the log. With a Python plugin created hardware but disabled(!), no problems.
Re: Stability with Python Plugins
Posted: Tuesday 05 December 2017 21:31
by febalci
Noudje wrote: ↑Tuesday 05 December 2017 20:47
Any one with the same experience? Any suggestions how to solve this?
Is the problem with a specific plugin or all? Using 3.8153 stable with 4 plugins on synology, didnot had any problem so far.
Re: Stability with Python Plugins
Posted: Tuesday 05 December 2017 21:53
by mrinner
Re: Stability with Python Plugins
Posted: Wednesday 06 December 2017 21:31
by Noudje
It happens with any python plugin, even with the standard template plugin!!!
I just did a new installation with the latest stretch liet version on a Raspberry 2. Hopefully better result now
Re: Stability with Python Plugins
Posted: Saturday 09 December 2017 18:53
by Noudje
The Raspberry Pi with a new installation of Domoticz (latest beta) works fine. Two python plugins now running for 3 days without any problem.
Re: Stability with Python Plugins
Posted: Saturday 09 December 2017 20:38
by mrinner
I tested on 2 dev machine the same set of plugins,
first with Ubuntu 16.04 with latest apt-get upgrades and latest beta - sometimes crashes
second with Ubuntu 16.04 without apt-get upgrades and latest beta - without crash for 4 days
Re: Stability with Python Plugins
Posted: Sunday 10 December 2017 3:16
by Dnpwwo
@mrinner and @Noudje,
Sorry to hear you are still having issues. I have tried to reproduce them without success unfortunately. The stack traces which have been posted show errors very deep in Python which means I can't determine the cause.
On my main system I run 8 plugins continuously and the last time I restarted it had been running for 22 days without issue.
There is definitely some sensitivity to underlying software though. It has been know for some time that building from source for RPi gives a much more stable system than using the betas and its interesting that an Ubuntu without some patches is more stable than a patched one.
Running vanilla Stretch on an RPi3 built from source with nothing else on the Pi has been rock solid for me and has been for months.
Do you have anything else running on your machines?
Re: Stability with Python Plugins
Posted: Sunday 10 December 2017 23:13
by Noudje
@Dnpwwo:
On one RPi2B with Jessie, is Domoticz (only) running for 2 years without any problems. This is the one with problems with plugins

.
An other RPi2B with Stretch and a complete new install of the latest beta is running very good. 3 Plugins are running without any problem

!!!
Re: Stability with Python Plugins
Posted: Monday 11 December 2017 10:10
by EdwinK
For me, this is still a problem. The Pi is only being used for Domoticz. The only thing I changed is that after booting everything else runs from an external drive. I do not really dare to compile this my self, as I'm not really into this. I rather install and forget. Besides, the instructions scare me a bit. I really hope that there will be a solution soon.
Re: Stability with Python Plugins
Posted: Friday 15 December 2017 10:44
by lrybak
I have the same issue.
Domoticz crash just after I enable plugin
see catchsegv log below
https://gist.github.com/lrybak/f7be098b ... 989895dd9b
I'm running RPI3 on stretch lite.
There are no many tools installed on that Pi, domoticz, monit, mosquitto and few really small tools
I have running domoticz on ubuntu server on vmware machine. Plugin works rock stable there
Re: Stability with Python Plugins
Posted: Sunday 17 December 2017 1:59
by Dnpwwo
Pushed a fix yesterday where plugins could crash when being stopped (or restarted) if they updated a device in onDisconnect or onStop.
Don't think it will help with general stability but every fixed issue get us closer to where we want to be !
Re: Stability with Python Plugins
Posted: Thursday 21 December 2017 22:04
by Noudje
I found out that most of the problems come from plugins using connections!
I created a simple plugin based on the HTTP.py example. In the example in onStart, you find:
Code: Select all
self.httpConn = Domoticz.Connection(Name="HTTP Test", Transport="TCP/IP", Protocol="HTTP", Address=Parameters["Address"], Port=Parameters["Port"])
self.httpConn.Connect()
I removed the last line and placed that in the onCommand and onHeartbeat procedures. It is running now for days without any problem.
Re: Stability with Python Plugins
Posted: Saturday 23 December 2017 19:52
by micha_pr
Noudje wrote: ↑Thursday 21 December 2017 22:04
I found out that most of the problems come from plugins using connections!
I created a simple plugin based on the HTTP.py example. In the example in onStart, you find:
Code: Select all
self.httpConn = Domoticz.Connection(Name="HTTP Test", Transport="TCP/IP", Protocol="HTTP", Address=Parameters["Address"], Port=Parameters["Port"])
self.httpConn.Connect()
I removed the last line and placed that in the onCommand and onHeartbeat procedures. It is running now for days without any problem.
Yes possible... I have got here (using Domoticz.Connection) as sample:
Code: Select all
'CConnection_send' failed 'TypeError':''dict' does not support the buffer interface'.
Re: Stability with Python Plugins
Posted: Saturday 23 December 2017 21:02
by gerardwr
Noudje wrote: ↑Thursday 21 December 2017 22:04
I found out that most of the problems come from plugins using connections!
That matches with a problem I encountered this week.
A plugin based on the plugin template, doing “almost nothing” has been running without problem for many months.
This week I started with a plugin using Http connections and suddenly Domticz crashes frequently.
Since I am just starting with those plug-ins I assumed I created the problem myself, So maybe I did not!
Thanks for the hint.
Re: Stability with Python Plugins
Posted: Sunday 24 December 2017 1:47
by Dnpwwo
@micha_pr,
You are getting an error returned, not a crash. If you post some of your code I can have a look to see if the Send function can be improved.
Re: Stability with Python Plugins
Posted: Sunday 24 December 2017 8:03
by micha_pr
Dnpwwo wrote: ↑Sunday 24 December 2017 1:47
@micha_pr,
You are getting an error returned, not a crash. If you post some of your code I can have a look to see if the Send function can be improved.
No, it is an additional part of the crash. Maybe not everytime it will appear in the log,
Please look here, there is the plugin and more info:
https://www.domoticz.com/forum/viewtopi ... 65&t=20625
Re: Stability with Python Plugins
Posted: Sunday 24 December 2017 9:25
by Dnpwwo
@micha_pr,
What version of the beta are you running? I had a look at the link you specified and the error message
Code: Select all
failed to parse parameters, Message or Message,Verb,URL,Headers,Delay expected.
is very out of date, the parameters (and error) are now
Code: Select all
failed to parse parameters, Message or Message, Delay expected.
can you update to the latest and see if the problem still exists?
Re: Stability with Python Plugins
Posted: Sunday 24 December 2017 9:50
by micha_pr
Hi,
I was going back to stable version, because of problems with plugin in latest Beta (3.8795).
Original errors came from 3.8794. See also here:
https://github.com/domoticz/domoticz/issues/1891
But release version didn't help. I will update to latest version again and tell you.