Domoticz suddenly totally empty

On various Hardware and OS systems: pi / windows / routers / nas, etc
Post Reply
Erik10
Posts: 11
Joined: Wednesday 03 October 2018 20:17
Target OS: Raspberry Pi
Domoticz version: 4.97
Contact:

Domoticz suddenly totally empty

Post by Erik10 » Tuesday 27 November 2018 16:22

My Domoticz implementation is suddenly very unstable.
I was working on MQTT scripts to set selector switches and then it went wrong (somehow, related or not).
From one moment to the other Domoticz is totally empty. No hardware, no, switches, no devices, no log.
I refreshed my browser and tried again, but then I became the Domoticz is Offline message.

I was afraid that the SD card was corrupted. Therefore I took a new SD card and restored the system (to 3 weeks back). At the time I made the back-up the system was stable.
Then I took a copy of the database of today and replaced the old restored database with the new one.

It looked like that solved the problem, but 3 days later the same thing happened. Domoticz totally empty again. Then I did a new restore on again a new SD card and used the old database from the restore. But even now, after just a few hours, the issue is back.

I use the latest stable version of Domoticz. For Zwave I have an Aeotec Zwave stick Gen 5. About 45 Zwave nodes. In total about 240 devices. In the Hardware: P1 over LAN, SBFspots, Netatmo, Motherboard sensors, MQTT gateway and some dummies.
I checked the database with: sqlite 3 ‘PRAGMA integrity_check’, it seems OK.
What could be the problem?

User avatar
waaren
Posts: 1376
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Domoticz suddenly totally empty

Post by waaren » Tuesday 27 November 2018 17:01

Erik10 wrote:
Tuesday 27 November 2018 16:22
From one moment to the other Domoticz is totally empty. No hardware, no, switches, no devices, no log.
How do you define totally Empty ? Is that this message from the Gui or
noData.png
noData.png (32.76 KiB) Viewed 258 times
or this result from sqlite

Code: Select all

sqlite3 domoticz.db
SQLite version 3.16.2 2017-01-06 16:32:41
Enter ".help" for usage hints.
sqlite> select count(*) from devicestatus;
0
sqlite>
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Erik10
Posts: 11
Joined: Wednesday 03 October 2018 20:17
Target OS: Raspberry Pi
Domoticz version: 4.97
Contact:

Re: Domoticz suddenly totally empty

Post by Erik10 » Tuesday 27 November 2018 17:13

In the GUI as you showed. No entries. The RPI is connected to the LAN by cable.
The database give a number e.g. 22750 not a zero.
I checked on the RPI, although domoticz is offline, domoticz.service is running.

Erik10
Posts: 11
Joined: Wednesday 03 October 2018 20:17
Target OS: Raspberry Pi
Domoticz version: 4.97
Contact:

Re: Domoticz suddenly totally empty

Post by Erik10 » Tuesday 27 November 2018 17:29

I (re-)checked the database the actual number was 222.

User avatar
waaren
Posts: 1376
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Domoticz suddenly totally empty

Post by waaren » Tuesday 27 November 2018 17:42

Erik10 wrote:
Tuesday 27 November 2018 17:13
In the GUI as you showed. No entries. The RPI is connected to the LAN by cable.
The database give a number e.g. 22750 not a zero.
I checked on the RPI, although domoticz is offline, domoticz.service is running.
It might well be a webserver problem. Unfortunately this can have many causes but luckily there are lots of posts about that issue on this forum. Just type webserver in the search bar at the top right corner of the screen and you will get > 1000 hits and in combination with MQTT > 35.

Until solved you could create a watchdog script or a monit check to restart domoticz if the domoticz webserver fails.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Erik10
Posts: 11
Joined: Wednesday 03 October 2018 20:17
Target OS: Raspberry Pi
Domoticz version: 4.97
Contact:

Re: Domoticz suddenly totally empty

Post by Erik10 » Tuesday 27 November 2018 19:25

I tried to restart Domoticz as soon as the program looses all and goes offline with:

Code: Select all

sudo service domoticz.sh start
but that does not help.

User avatar
waaren
Posts: 1376
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Domoticz suddenly totally empty

Post by waaren » Tuesday 27 November 2018 19:29

Did you try service domoticz restart ?
Erik10 wrote:I tried to restart Domoticz as soon as the program looses all and goes offline with:

Code: Select all

sudo service domoticz.sh start
but that does not help.
Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk

Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Erik10
Posts: 11
Joined: Wednesday 03 October 2018 20:17
Target OS: Raspberry Pi
Domoticz version: 4.97
Contact:

Re: Domoticz suddenly totally empty

Post by Erik10 » Tuesday 27 November 2018 20:25

Now I did and it is working. :D Thank you so much!

At first I had to restart about every minute. But now Domoticz is running for at least 20 minutes.
So no corrupted database and no corrupted SD card. That is the good news.
I will go for a watchdog of monit solution. But that is not the real solution of cause.
I read a lot of the posts already but did not (yet) see one that gave me a direction to find a real solution for this problem.
Can anybody give me a hint?

mvzut
Posts: 453
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Domoticz suddenly totally empty

Post by mvzut » Tuesday 27 November 2018 22:55

My Domoticz system (latest beta on a Raspberry Pi) has also been giving me headaches since a couple of days. I was installing HA-bridge, and suddenly Domoticz went offline while I was doing some configuration stuff. At first I thought it might be related to my changes, but now I start to doubt this...

To get up and running again, I did a clean install of Domoticz on a clean Stretch image, and put a one day old domoticz.db back. That helped at first, but after a day I got the same problem, and restoring again helped only for a few hours this time. It threw errors about the database being malformed, which I could solve by exporting the database to an sql file and importing it again into a new .db file.

Problem solved? No, this morning it stopped again! I started to wonder if the SD card could be corrupt? I changed the SD card, and configured Domoticz to write a lot of the temporary stuff (like logs etc.) to a RAM drive. Keeping my fingers crossed now... If this doesn't help, I'm going to exchange my power supply (although this has always been powerful enough). If anyone has other tips, please let me know!

Not exactly the same as your problem, but as it could be related, I took the liberty to post my issue here instead of starting a new topic.
Raspberry Pi 3 - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Xiaomi Gateway - Sonos - IP cameras - Wall mounted tablet + Imperihome - Alexa - MANY switches/sensors

CaesarPL
Posts: 130
Joined: Tuesday 08 November 2016 15:03
Target OS: Raspberry Pi
Domoticz version:
Location: Poland
Contact:

Re: Domoticz suddenly totally empty

Post by CaesarPL » Wednesday 28 November 2018 12:01

1. Move to HDD/SSD
2. Check your plugins
3. Install monit
HW:Raspberry PiB+,Pi3,PiB,RFLink,FA20RF,DCS-930L,DCS-935L,Clarus switches,RF Temp sensors,Owl Micro+,Mi Flora,Kerui,Yeelight,Xiaomi,Broadlink RMM3,Alexa
SF:Jessie,Dmtcz 3.8153,Logitech Media srv,PiCorePlayers,Dashticz,Max2Play,InfluxDB,Grafana,HABridge

mvzut
Posts: 453
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Domoticz suddenly totally empty

Post by mvzut » Wednesday 28 November 2018 22:33

Ouch, it just happened again with a new SD card.
I was able to get things working again by simply restoring the last backed-up db file (I turned automatic backups on).
The db file after the crash gave no errors in an sqlite3 integrity check.

I don't think it is the SD card. Could it be the power adaptor? It is a good one with enough power, has been working fine for a couple of years now.
I'll also check my plugins, although I haven't changed anything there the last few days.
I have crash logs, but I feel they are not of much use (Domoticz log just says fatal error 6).
Raspberry Pi 3 - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Xiaomi Gateway - Sonos - IP cameras - Wall mounted tablet + Imperihome - Alexa - MANY switches/sensors

mvzut
Posts: 453
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Domoticz suddenly totally empty

Post by mvzut » Monday 03 December 2018 21:25

Ok, good that you reminded me to look at the plugins. I think it was the Sonos Python plugin in combination with a Sonos One with Alexa activated. The status messages it gives after having done some Alexa tricks are different than what the plugin expects. Although I still find it hard to believe that this can cause a corrupt database, removing the plugin seems to have solved my problem. I haven't had a crash since almost three days, a record! Let's hope it stays that way...
Raspberry Pi 3 - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Xiaomi Gateway - Sonos - IP cameras - Wall mounted tablet + Imperihome - Alexa - MANY switches/sensors

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests