I am running the latest beta on a RPI 3B (now V4.10110)
It has a USB RFLink gateway and a ZWave stick.
For some time now, I have problems with domoticz at reboot, lets say after an update. Also, domoticz stops quite often (once in two weeks on average)
Hence I started to log things.
I caught the following lines in the domoticz.txt log file.
i'm googling around to get some hints to solve my issue with this:
2019-01-08 23:47:19.558 Error: mainworker seems to have ended or hung unexpectedly (last update 301.000000 seconds ago)
2019-01-08 23:47:19.588 Error: Domoticz(13598) is exiting due to watchdog triggered...
2019-01-08 23:47:19.646 Error: Failed to start gdb, will use backtrace() for printing stack frame
This occurs after every start of domoticz, so my domoticz is not usable any more.
Got the same log yesterday, after stopping my PI3 (shutdown -h now) to make a SD image (I do so after every upgrade, after a while when everything looks OK... and upgraded to last stable about 1 month ago):
lost wrote: Sunday 06 October 2019 8:43
Got the same log yesterday, after stopping my PI3 (shutdown -h now)
2019-10-05 11:38:47.327 Error: mainworker seems to have ended or hung unexpectedly (last update 2179.000000 seconds ago)
It's time offset related. Domoticz starts before the time is properly set and see a time from the past (kept by fake-hwclock). When the time is adjusted to the time of an NTP server domoticz is not aware what happened and assume it was dead for xxxx seconds. Watchdog barks and stops domoticz.
Several ways to deal with this (delay domoticz start after shutdown / boot, install hardware clock, ntp-wait, etc..)
#
# Function that starts the daemon/service
#
do_start()
{
#wait for network time to complete
ntp-wait
if [[ $? -ne 0 ]];then
echo ntp-wait did return with an error condition
exit 1
fi
lost wrote: Sunday 06 October 2019 8:43
Got the same log yesterday, after stopping my PI3 (shutdown -h now)
2019-10-05 11:38:47.327 Error: mainworker seems to have ended or hung unexpectedly (last update 2179.000000 seconds ago)
It's time offset related. Domoticz starts before the time is properly set and see a time from the past (kept by fake-hwclock). When the time is adjusted to the time of an NTP server domoticz is not aware what happened and assume it was dead for xxxx seconds. Watchdog barks and stops domoticz.
Several ways to deal with this (delay domoticz start after shutdown / boot, install hardware clock, ntp-wait, etc..)
#
# Function that starts the daemon/service
#
do_start()
{
#wait for network time to complete
ntp-wait
if [[ $? -ne 0 ]];then
echo ntp-wait did return with an error condition
exit 1
fi
OK, makes sense. NTP is already installed but if Domoticz starts before...
Thanks a lot, I'll modify my startup script!
# Function that starts the daemon/service
#
do_start()
{
#wait for network time to complete
ntp-wait
if [[ $? -ne 0 ]];then
echo ntp-wait did return with an error condition
exit 1
fi
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --chuid $USERNAME --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}
lost wrote: Sunday 06 October 2019 8:43
Got the same log yesterday, after stopping my PI3 (shutdown -h now)
2019-10-05 11:38:47.327 Error: mainworker seems to have ended or hung unexpectedly (last update 2179.000000 seconds ago)
It's time offset related. Domoticz starts before the time is properly set and see a time from the past (kept by fake-hwclock). When the time is adjusted to the time of an NTP server domoticz is not aware what happened and assume it was dead for xxxx seconds. Watchdog barks and stops domoticz.
Several ways to deal with this (delay domoticz start after shutdown / boot, install hardware clock, ntp-wait, etc..)
#
# Function that starts the daemon/service
#
do_start()
{
#wait for network time to complete
ntp-wait
if [[ $? -ne 0 ]];then
echo ntp-wait did return with an error condition
exit 1
fi
pi@P1-Logger:~ $ sudo apt install ntp
Pakketlijsten worden ingelezen... Klaar
Boom van vereisten wordt opgebouwd
De statusinformatie wordt gelezen... Klaar
ntp is reeds de nieuwste versie (1:4.2.8p12+dfsg-4).
0 opgewaardeerd, 0 nieuw geïnstalleerd, 0 te verwijderen en 0 niet opgewaardeerd.
2 niet volledig geïnstalleerd of verwijderd.
Na deze bewerking zal er 0 B extra schijfruimte gebruikt worden.
Wilt u doorgaan? [J/n] j
Instellen van owserver (3.2p3+dfsg1-2) ...
Job for owserver.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status owserver.service" and "journalctl -xe" for details.
invoke-rc.d: initscript owserver, action "start" failed.
● owserver.service - Backend server for 1-wire control
Loaded: loaded (/lib/systemd/system/owserver.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/owserver.service.d
└─override.conf
Active: activating (auto-restart) (Result: protocol) since Sun 2020-03-01 19:38:47 CET; 477ms ago
Docs: man:owserver(1)
Process: 11238 ExecStart=/usr/bin/owserver -c /etc/owfs.conf (code=exited, status=0/SUCCESS)
Main PID: 11238 (code=exited, status=0/SUCCESS)
mrt 01 19:38:47 P1-Logger systemd[1]: owserver.service: Service RestartSec=100ms expired, scheduling restart.
mrt 01 19:38:48 P1-Logger systemd[1]: owserver.service: Scheduled restart job, restart counter is at 1.
mrt 01 19:38:48 P1-Logger systemd[1]: Stopped Backend server for 1-wire control.
dpkg: fout bij verwerken van pakket owserver (--configure):
subproces van pakket owserver werd script post-installation geïnstalleerd gaf de foutwaarde 1 terug
dpkg: vereistenproblemen verhinderen de configuratie van owfs:
owfs is afhankelijk van owserver (>= 3.2p3+dfsg1-2); maar:
Pakket owserver is nog niet geconfigureerd.
dpkg: fout bij verwerken van pakket owfs (--configure):
vereistenproblemen - blijft ongeconfigureerd
Fouten gevonden tijdens verwerken van:
owserver
owfs
E: Sub-process /usr/bin/dpkg returned an error code (1)
Sounds unlogical to me too but why do I get the errors when I try to install ntp?
Both problems (1wire and the crash after a restart) are since the mandatory update to buster.
roblom wrote: Sunday 01 March 2020 21:46
Sounds unlogical to me too but why do I get the errors when I try to install ntp?
Both problems (1wire and the crash after a restart) are since the mandatory update to buster.
If you read the messages you will see that NTP is already installed. No further action is required for that one.
You see the other messages because the packet manager (apt) you use while trying to install NTP is informing you on the incomplete state of all packages (where applicable) you will see the same messages if you install any other package using apt.