Switching to MYSQL = server crashes without log

SYSTADO2 years ago

I did alter the config according to the FAQ
But as soon as i start traccar on UBUNTU now it crashes but does not write anything to the log?

gps@localhost:/opt/traccar/logs$ sudo service traccar start
gps@localhost:/opt/traccar/logs$ sudo service traccar status
● traccar.service - traccar
     Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Wed 2022-11-30 15:04:19 UTC; 874ms ago
    Process: 65161 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=1/FAILURE)
   Main PID: 65161 (code=exited, status=1/FAILURE)
        CPU: 2.122s

Nov 30 15:04:19 localhost systemd[1]: traccar.service: Consumed 2.122s CPU time.

Where can i find any clue if /opt/traccar/logs/tracker-server.log just has nothing about the crash ?
As soon as i alter back to H2 Database everything starts fine, but still my config is correct, the tables are created nevertheless before
server crashes, so its safe to say connection works

Anton Tananaev2 years ago

Check your config file. If server doesn't start without any logs, it usually indicates that your config file has an error. Remember that you need to escape all special characters (e.g. in password) to make it a valid XML.

SYSTADO2 years ago

As i said traccar did connect to the mysql correctly for it created all tables inside the database correctly before crashing.

SYSTADO2 years ago

ok im frustrated now i did change nothing exept the mysql config and i tried goingback to H2 some times it worked. but now it just wont start up anymore no matter if i have h2 or mysql in config

<?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='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>

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>nominatim</entry>
    <entry key='geocoder.url'>https://eu1.locationiq.com/v1/reverse</entry>
    <entry key='geocoder.key'>[CENSORED FOR FORUM]</entry>
    <entry key='geocoder.onRequest'>true</entry>
    <entry key='geocoder.ignorePositions'>true</entry>

    <entry key='mail.smtp.host'>mail.berlin.de</entry>
    <entry key='mail.smtp.port'>465</entry>
    <entry key='mail.smtp.ssl.enable'>true</entry>
    <entry key='mail.smtp.ssl.trust'>*</entry>
    <entry key='mail.smtp.from'>alarm@berlin.de</entry>
    <entry key='mail.smtp.auth'>true</entry>
    <entry key='mail.smtp.username'>alarm@berlin.de</entry>
    <entry key='mail.smtp.password'>SundGauer105!</entry>

</properties>
Anton Tananaev2 years ago

Again, I'm pretty sure it's invalid config format. Try to run manually like this and see if you get any errors in the console:

cd /opt/traccar
/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
SYSTADO2 years ago

Yes i get that you are right but i dont know what the problem is in the file :(
I get the "Configuration file is not a valid XML document" error but have no clue where the error is.
Its back to my original backup version and still does not start

Anton Tananaev2 years ago

Run it through any XML validation tool and it should give you the details.

SYSTADO2 years ago

It did not show any errors. i just reinstalled everything and it works now.
Is there a way to import the H2 into the mysql so i dont have to start configuring everything from the ground ?

Anton Tananaev2 years ago

There are ways, but not easy. Search the forum. It has been discussed a couple of times and people even posted some step by step guides.

SYSTADO2 years ago

thx