Traccar does not display anything

Rick971602 years ago

Hello community!!!
I installed the latest version of traccar on ubuntu 20.04, but when launching the web page, my screen remains white..
If anyone can give me a hand, thank you!!
Here is the traccar log file:

2022-08-21 03:41:14  INFO: Operating system name: Linux version: 5.4.0-122-generic architecture: amd64
2022-08-21 03:41:14  INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: ojdkbuild version: 11.0.15+10-LTS
2022-08-21 03:41:14  INFO: Memory limit heap: 467mb non-heap: 0mb
2022-08-21 03:41:14  INFO: Character encoding: UTF-8 charset: UTF-8
...
2022-08-21 03:41:28  INFO: ChangeSet changelog-5.3::changelog-5.3::author ran successfully in 240ms
2022-08-21 03:41:28  INFO: Successfully released change log lock
2022-08-21 03:41:29  INFO: Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
2022-08-21 03:41:33  INFO: jetty-10.0.7; built: 2021-10-06T19:34:02.766Z; git: da8a4553af9dd84080931fa0f8c678cd2d60f3d9; jvm 11.0.15+10-LTS
2022-08-21 03:41:33  INFO: Started o.t.w.@2f07930a{/,null,AVAILABLE}
2022-08-21 03:41:33  INFO: Session workerName=node0
2022-08-21 03:41:34  WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2022-08-21 03:41:36  INFO: Started o.e.j.s.ServletContextHandler@3387ab0{/,null,AVAILABLE}
2022-08-21 03:41:36  INFO: Started ServerConnector@11148dc2{HTTP/1.1, (http/1.1)}{0.0.0.0:80}
2022-08-21 03:41:36  INFO: Started Server@1846ad0f{STARTING}[10.0.7,sto=0] @23131ms
2022-08-21 03:41:36  INFO: Health check enabled with period 480000
Rick971602 years ago

Here is MysqL status:

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset:>
     Active: active (running) since Sat 2022-08-20 05:49:29 UTC; 23h ago
   Main PID: 3819 (mysqld)
     Status: "Server is operational"
      Tasks: 51 (limit: 2281)
     Memory: 398.1M
     CGroup: /system.slice/mysql.service
             └─3819 /usr/sbin/mysqld

Aug 20 05:49:27 vps-a9965426 systemd[1]: Starting MySQL Community Server...
Aug 20 05:49:29 vps-a9965426 systemd[1]: Started MySQL Community Server.
Rhamean2 years ago

Have you had older version of database with data before doing this?

Rick971602 years ago

Here the traccar properties file:

<?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>
<entry key='web.port'>8082</entry>
<entry key='database.driver'>com.mysql.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://localhost/'THE DATABASE'?allowPublicKeyRetrieval=true&amp;useSSL=false&amp;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'>'The USER'</entry>
<entry key='database.password'>'THE PASSEWORD'</entry>
</properties>
Rick971602 years ago

hi Rhamean!!
It is a new installation, the DB is empty

Rhamean2 years ago

Hi dear Rick97160,

You need to create an empty database first and name it with something like 'TraccarDB', and the mysql user should have granted to the database.
if you don't mind i suggest you to set these configs first:

  1. get in mysql: "$ sudo mysql -u root -p" and run these commands as below:
create database TraccarDB;
create user 'trackuser'@'localhost' identified with mysql_native_password by 'Password#123';
grant all privileges on *.* to 'trackuser'@'localhost' with grant option;
flush privileges;
exit;
  1. set this in debug.xml :
    "$ sudo nano [your_path]/traccar/debug.xml"
                    <!--    <entry key='database.driver'>org.h2.Driver</entry>-->
                    <!--    <entry key='database.url'>jdbc:h2:./target/database</entry>-->
                    <!--    <entry key='database.user'>sa</entry>-->
                    <!--    <entry key='database.password'></entry>-->

                    <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
                    <entry key='database.url'>jdbc:mysql://localhost/TraccarDB?allowPublicKeyRetrieval=true&amp;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='web.enable'>true</entry>
                    <entry key='web.port'>8082</entry>
                    <entry key='database.user'>trackuser</entry>
                    <entry key='database.password'>Password#123</entry>
  1. uninstall previous traccar : // info from -> https://www.traccar.org/linux/
                    sudo systemctl stop traccar
                    sudo systemctl disable traccar
                    sudo rm /etc/systemd/system/traccar.service
                    sudo systemctl daemon-reload
                    sudo rm -R /opt/traccar

Now you are good to go to install again.

Rhamean2 years ago

unfortunately some part of my reply is missing after submit, I write them again
...privileges on *.* to 'trackuser'@...
and you need to disable or remove the lines as below in debug.xml file:

<entry key='database.driver'>org.h2.Driver</entry>
<entry key='database.url'>jdbc:h2:./target/database</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'></entry>
Rhamean2 years ago

grant all privileges on [star].[star] to 'trackuser'@'localhost' with grant option;

Rick971602 years ago

Ok Thank you, i'll try and I come back to you...!!

Rick971602 years ago

Hi Rhamean,
I have a problem to test your advice...
I don't have the file : debug.xml !!!

Rhamean2 years ago

You are right. Sorry it was my bad. I meant traccar.xml.
debug.xml is used for development of source code.
The path is here: /opt/traccar/conf/traccar.xml

Rick971602 years ago

Hi Rhamean, I tried what you advised me, still nothing....I can't launch traccar !!