Traccar 4.9 restarting every 90 seconds

rado4 years ago

Hello, could anyone provide any guidance on this issue? I did a fresh install of Traccar Server 4.9 on a Xubuntu 18.04 x64 VirtualBox image running OpenJDK. This is a default install with no configuration changes. The server works and accepts connections, but restarts every 90 seconds or so with no error in the logs - it just restarts itself with a short downtime during the boot process. There is virtually no load and it keeps happening consistently (I have only tested 2 trackers with it and it happens even when they are off). The behavior seems to be database independent, it happens with the default H2 instance as well as when used with a PostgreSQL database. There is nothing in the log - no error whatsoever - it just suddenly starts rebooting with the hikari pool initialization and all the other liquibase messages following. Any ideas? Anyone experienced a similar behavior?

Lukasz4 years ago

Yes, it's probably a watchdog problem. Read, it was on the forum.

rado4 years ago

Thanks for the pointers. I must have been using the wrong keywords (I searched the forums, google, github and most issues were related to crashes / restarts after a few days). Watchdog was THE word to search for. Thanks!

So bumping Xmx to 1G and increasing the period from 80 to 600 seconds seems to have resolved the issue - the server has been up for over 10 minutes now so fingers crossed. This is just a demo / testing setup but it was very annoying.

shyy4 years ago

https://www.traccar.org/forums/topic/watchdog-systemd/

edit the traccar.service
/etc/systemd/system/traccar.service

you need to change WatchdogSec=10 to WatchdogSec=300

rado4 years ago

Yup, that's exactly what I did (but I did set it to 600 seconds) and it's been running for 5 hours with no issues now. Thanks! :-)

Slawek4 years ago

In my system WatchdogSec=300 restarting system every 300 s (ubuntu 16.04 on VPS).

600 s is 10 min, that mean in case of system failure you lost 10 min logging, its a lot.

What do you think about

Restart=always
RestartPreventExitStatus=255

Javier Gonzalez4 years ago

Set this config in /etc/systemd/system/traccar.service

SuccessExitStatus=143
#WatchdogSec=600
#Restart=on-failure
Restart=Always
#RestartSec=10