Page 1 of 1

Domoticz not accessible via web after some days or hours

Posted: Tuesday 25 March 2025 19:17
by Artax
Version: 2024.7
Build Hash: b317cfab1
Compile Date: 2024-07-13 16:59:31
dzVents Version: 3.1.8
Python Version: 3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0]
Platform: Pi4b 4GB
Plugin/Hardware: MQTT Client Gateway

My system:
I use domoticz at a Pi4b 4GB in combination with only virtual Seonsors and Actors (Dummy Devices).
At the same Pi4B (actual distribution and updates) I have installed Node-Red (offical and actual release).
At a different hardware I use an MQTT Broker (Server).
Node-Red has subscribed some of the values from the MQTT server, make some calculations and
sends the results for visualisation via JSON to Domoticz.
For switching purposes Domoticz sends MQTT data direct to the MQTT broker.
MQTT Broker and the Pi4b are connected via LAN at the same ethernet switch (1Gbit).
Automatic domoticz backup is enabled.
Devices used are Energy meter, Percentage, Text and temperature.

I set up the system in 2024 and increase the amout from initial 20 domoticz dummy device, step by step, up to 70 now.

Initial all work perfect. But start at christmas time last year I get problems to access the domoticz webpages.
Sometimes after some weeks, sometimes after some hours.
If the problem occurs I get a timeout message from the browser (http and https) and permanent no connection.
Connect the Pi4B via SSH is still possible, RemoteDesktop too.
The Remote Desktop show no overheating of the Pi4b and a CPU load of 25-30% (with running RDP).
All requested testtasks acts fast, no performance problem.
The webpage of Node-Red (located at the same Pi4b) is still accessable.

So my conclution is that the problem is Domoticz and not Node-Red or the Pi4b itself.
Node-Red shows that all trafic send to Domoticz via JSON stops with timeout (No answer).
The only way I found to fix the problem is to stop the Node-Red service, restart the domoticz and start the Node-Red service again.
This works, for days or minutes.
It seems that the problem occus more often if I actually use the Domoticz webend.
After restart the domoticz service I have lost all data during the time the failure occurs, so the failure stops receiving and storage of the data into the database.

To temporary fix the problem I wrote a python program. This program quest every minute the domoticz Version via JSON.
If the failure occurs this read finish with a timeout. Then I automatic stop Node-Red service, restart Domoticz service and start Node-Red service again.
The actions are written to a log. Because of this log I have the info how often the problem occurs.
After restart the domoticz service the domoticz log shows no relevant entries.

I have checked that each Sensorvalue send to domoticz has an updaterate of 5 seconds or more seconds (most 1 minute).
I replace the Pi4b inclusive original Pi powersupply by a identical one.
I install a fresh Raspian, Node-Red and Domoticz.

The sensor data are send via http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx=xx&nvalue=0&svalue=val for example for "General kWh".

What could be the reason?
What is my failure?

Regards

Thomas

Re: Domoticz not accessible via web after some days or hours

Posted: Tuesday 25 March 2025 19:26
by jvdz
Have you checked/enabled the domoticz logging for errors, as I guess something is crashing for some reason?

Re: Domoticz not accessible via web after some days or hours

Posted: Tuesday 25 March 2025 19:30
by waltervl
Check the troubleshooting wiki for some hints on fault finding https://wiki.domoticz.com/Troubleshooting
Especially check the logs as already indicated by jvdz.

Re: Domoticz not accessible via web after some days or hours

Posted: Tuesday 25 March 2025 20:01
by Artax
I have checked the log accessable via the web fronend.
Last crashed today 17:43:50; Restart initated at 17:45:00
Only maybe relevant log entry is
2025-03-25 17:46:43.557 Error: GetJSonDevices: exception occurred : 'stoull'
I found no chrash log at install folder.
As described at the toubleshouting I have now activated the option
DAEMON_ARGS="DAEMON_ARGS -log /tmp/domoticz.txt"

When The failure occurs next time I will post the content of the log.

Re: Domoticz not accessible via web after some days or hours

Posted: Tuesday 25 March 2025 20:21
by jvdz

Re: Domoticz not accessible via web after some days or hours

Posted: Wednesday 26 March 2025 18:15
by Artax
The next crash occurs today at 15:09:52
I look in the crash log and find
2025-03-26 15:08:54.163 Error: GetJSonDevices: exception occurred : 'stoull'
2025-03-26 15:08:54.254 Error: GetJSonDevices: exception occurred : 'stoull'
2025-03-26 15:08:54.320 Error: GetJSonDevices: exception occurred : 'stoull'
2025-03-26 15:12:44.366 Status: Domoticz V2024.7 (c)2012-2024 GizMoCuz
2025-03-26 15:12:44.366 Status: Build Hash: b317cfab1, Date: 2024-07-13 16:59:31
1 minute before the crash was traced the last exeption occurs.
3 minutes later the restart of the domoticz service do there job and the start message was printed in the log.
Because my "watchdog" looks every minute it could be that the crash was direct behind 15:08:54.
Remark: At this time the domoticz webend was not accessed since hours.

I looked to https://github.com/domoticz/domoticz/issues/6083
I have started with 2024.4 and switch later to 2024.7
pTypeRFXMeter is not used by me.
I use only
  • Generell Text
  • General kWh
  • General customer sensor
  • General alert
  • General Percentage
  • P1 Smart Meter Energy
  • Temp LaCrosse TX3
  • Light/Switch Switch
  • Light/Switch Selector Switch
All my devices are created via the webend Setup/Hardware/Dummy not by json.

I will check all svalue send to domoticz, but it needs some time.

Re: Domoticz not accessible via web after some days or hours

Posted: Wednesday 09 April 2025 18:16
by Artax
I have checked all different sensor types step by step to find not valid "svalue" transmissions.
All, except one, without any finding.
But the "General Percentage" get at very rare cases empty "Svalue" at my implementation, values below 0 or higher than 100. This iritate Domoticz so much that it crash.
Now I have insert a filter and it work as aspected.

Thank you of the hint about the "svalue".