Data from devices stopped coming in to traccar server?

qlex4 years ago

Hi,
traccar is a great tool, but yesterday around 5:38am my server stopped receiving any data from Teltonika devices.
I have restarted the service - no change,
I have testing if port is open - it's open
I have checked /opt/traccar/logs - this folder is empty

How can i troubleshoot why did the data stop coming in ?

Help !

Regards,

Slawek4 years ago

check

sudo service traccar status

qlex4 years ago

It says:

root@iplaner:/home/wojciech# service traccar status
● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled)
   Active: active (running) since pią 2020-12-18 12:51:13 CET; 969ms ago
 Main PID: 12563 (java)
   CGroup: /system.slice/traccar.service
           └─12563 /opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml

gru 18 12:51:13 iplaner.pl systemd[1]: Started traccar.
gru 18 12:51:14 iplaner.pl traccar[12563]: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The drive...nnecessary.
Hint: Some lines were ellipsized, use -l to show in full.

And service tracar status -l says:

root@iplaner:/home/wojciech# service traccar status -l
● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled)
   Active: activating (auto-restart) (Result: exit-code) since pią 2020-12-18 12:52:14 CET; 2s ago
  Process: 13526 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=1/FAILURE)
 Main PID: 13526 (code=exited, status=1/FAILURE)

gru 18 12:52:14 iplaner.pl systemd[1]: Unit traccar.service entered failed state.
root@iplaner:/home/wojciech#

But website is still running.

Slawek4 years ago

show

traccar.xml

qlex4 years ago

Interestingly i can see traccar log as well. it keeps repeating:

2020-12-18 13:00:55  INFO: HikariPool-1 - Starting...
2020-12-18 13:00:55  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2020-12-18 13:00:56 ERROR: HikariPool-1 - Exception during pool initialization. - Malformed database URL, failed to parse the main URL sections. - WrongArgumentException (... < DataManager:139 < *:89 < Context:292 < Main:137 < ...)
2020-12-18 13:00:56 ERROR: Main method error - Malformed database URL, failed to parse the main URL sections. - WrongArgumentException (... < DataManager:139 < *:89 < Context:292 < Main:137 < ...)
2020-12-18 13:01:07  INFO: HikariPool-1 - Starting...

My config looks like this:

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <entry key='config.default'>./conf/default.xml</entry>

    <!--

    This is the main configuration file. All your configuration parameters should be placed in this file.

    Default configuration parameters are located in the "default.xml" file. You should not modify it to avoid issues
    with upgrading to a new version. Parameters in the main config file override values in the default file. Do not
    remove "config.default" parameter from this file unless you know what you are doing.

    For list of available parameters see following page: https://www.traccar.org/configuration-file/

    -->

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql:./data/database?serverTimezone=UTC&amp;</entry>
    <entry key='database.user'>sa</entry>
    <entry key='database.password'></entry>

</properties>

I guess my timezone should be CET as well?

Slawek4 years ago

did you do mysql database for traccar ?

witch ver traccar did you install ?

qlex4 years ago

It worked since i installed it. I haven't touched mysql for that.
I belive traccar 4, installed in september 2020 - i acutally updated older version

Slawek4 years ago

your config looks wrong

correct for h2 database

<entry key='database.driver'>org.h2.Driver</entry>
<entry key='database.url'>jdbc:h2:./data/database</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'></entry>

for mysql

<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry> 
<entry key='database.url'>jdbc:mysql://127.0.0.1:3306/traccar?serverTimezone=UTC&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
<entry key='database.user'>root</entry> 
<entry key='database.password'>your_password</entry>

witch database do you use ?

qlex4 years ago

im using mysql.
checked if mysql user has access to that database and confirmed.

after modyfing the mysql entry, stopping service and starting it, i get this status:

root@iplaner:/opt/traccar/conf# service traccar status
● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled)
   Active: activating (auto-restart) (Result: exit-code) since pią 2020-12-18 13:34:11 CET; 2s ago
  Process: 26197 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=1/FAILURE)
 Main PID: 26197 (code=exited, status=1/FAILURE)

gru 18 13:34:11 iplaner.pl systemd[1]: Unit traccar.service entered failed state.

Can i change to H2 ? I don't care about historial data, just need the service to be running.

Slawek4 years ago

just use config for h2 database

read this if you want use mysql

https://www.traccar.org/install-digitalocean/

qlex4 years ago

to choose h2 i use that stock config without password for user ?

Slawek4 years ago

yes

qlex4 years ago

ok, i manged to get it runing, but now i cant login.

DO i need to recreate users? Where do I add them if this is H2 database instead of Mysql ?

Slawek4 years ago

try

admin
admin

qlex4 years ago

World!
How do i import devices, users etc?