Traccar Server Ubuntu Installation

Kyle7 years ago

Hello all. I installed Traccar server on Ubuntu using the instructions here: https://www.traccar.org/install-digitalocean/

To start the server I run: /opt/traccar/bin/startDaemon.sh
The output from that command ends with: Service traccar started

However when I run: tail -f /opt/traccar/logs/wrapper.log.*
I see the following: INFO|wrapper|Service traccar|18-09-16 20:07:21|exit code posix process: 59136 application(status/signal): 231/0

Running the command 'service --status-all' shows the follow for Traccar: [ - ] traccar

Does anyone know what I can do to get the service started? My traccar.xml file looks like this:

<properties>

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

    <entry key='web.port'>80</entry>

    <entry key='geocoder.enable'>false</entry>

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost/traccar?allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-$
    <entry key='database.user'>root</entry>
    <entry key='database.password'>******</entry>

    <entry key='server.timeout'>120</entry>

</properties>

Thanks for the help!

Kyle7 years ago

I forgot to add that the output for MySQL in 'service --status-all' is: [ + ] mysql

I can also connect to the MySQL database via the command line.

Anton Tananaev7 years ago

You need to properly check log files.

Kyle7 years ago

The rest of the log file is as follows:

==> /opt/traccar/logs/wrapper.log.20180916 <==
FINEST|8783/0|Service traccar|18-09-16 20:07:21|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1714)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2190)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|	at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2037)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|	... 28 more
INFO|wrapper|Service traccar|18-09-16 20:07:21|waitpid 8783 59136
INFO|wrapper|Service traccar|18-09-16 20:07:21|exit code posix process: 59136 application(status/signal): 231/0

It looks to be that Traccar is trying to connect to MySQL but is unable to.

Anton Tananaev7 years ago

No, that's not the rest of the log file. You need to look at the full file.

Kyle7 years ago

Would it be in /opt/traccar/logs? If so, which file would it be?

Anton Tananaev7 years ago

Same file.

Kyle7 years ago

The following lines stood out to me:

INFO|8783/0|Service traccar|18-09-16 20:07:21|[main] ERROR com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initialization.
INFO|8783/0|Service traccar|18-09-16 20:07:21|com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
INFO|8783/0|Service traccar|18-09-16 20:07:21|Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost'

The full file is below:

WARNING|wrapper|Service traccar|18-09-16 20:07:12|YAJSW: yajsw-stable-12.12
WARNING|wrapper|Service traccar|18-09-16 20:07:12|OS   : Linux/4.15.0-30-generic/amd64
WARNING|wrapper|Service traccar|18-09-16 20:07:12|JVM  : Oracle Corporation/10.0.2//usr/lib/jvm/java-11-openjdk-amd64/64
INFO|wrapper|Service traccar|18-09-16 20:07:12|exec:java -classpath /opt/traccar/wrapperApp.jar:/opt/traccar/tracker-server.jar:/opt/traccar/lib/log4j-1.2.17.jar:/opt/traccar/lib/joda-time-2.10.jar:/opt/traccar/lib/co$
INFO|wrapper|Service traccar|18-09-16 20:07:12|posix_spawn pid 8783
INFO|wrapper|Service traccar|18-09-16 20:07:12|started process 8783
INFO|wrapper|Service traccar|18-09-16 20:07:12|started process with pid 8783
INFO|8783/0|Service traccar|18-09-16 20:07:14|[INFO] StandardFileSystemManager - Using "/tmp/vfs_cache" as temporary files store.
INFO|8783/0|Service traccar|18-09-16 20:07:15|SLF4J: Class path contains multiple SLF4J bindings.
INFO|8783/0|Service traccar|18-09-16 20:07:15|SLF4J: Found binding in [jar:file:/opt/traccar/lib/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
INFO|8783/0|Service traccar|18-09-16 20:07:15|SLF4J: Found binding in [jar:file:/opt/traccar/lib/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
INFO|8783/0|Service traccar|18-09-16 20:07:15|SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
INFO|8783/0|Service traccar|18-09-16 20:07:15|SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
INFO|8783/0|Service traccar|18-09-16 20:07:15|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
INFO|8783/0|Service traccar|18-09-16 20:07:16|Sun Sep 16 20:07:16 UTC 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ re$
INFO|8783/0|Service traccar|18-09-16 20:07:21|[main] ERROR com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initialization.
INFO|8783/0|Service traccar|18-09-16 20:07:21|com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.Util.getInstance(Util.java:408)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2096)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2021)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:112)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:118)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:341)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:193)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:428)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:499)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:112)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:72)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.traccar.database.DataManager.initDatabase(DataManager.java:134)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.traccar.database.DataManager.<init>(DataManager.java:87)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.traccar.Context.init(Context.java:361)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.traccar.Main.main(Main.java:35)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/java.lang.reflect.Method.invoke(Method.java:564)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|8783/0|Service traccar|18-09-16 20:07:21|Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost'
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1714)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2190)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2037)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  ... 28 more
INFO|8783/0|Service traccar|18-09-16 20:07:21|java.lang.reflect.InvocationTargetException
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/java.lang.reflect.Method.invoke(Method.java:564)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|8783/0|Service traccar|18-09-16 20:07:21|Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 $
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:528)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:520)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:112)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:72)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.traccar.database.DataManager.initDatabase(DataManager.java:134)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.traccar.database.DataManager.<init>(DataManager.java:87)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.traccar.Context.init(Context.java:361)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at org.traccar.Main.main(Main.java:35)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  ... 6 more
INFO|8783/0|Service traccar|18-09-16 20:07:21|Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.Util.getInstance(Util.java:408)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2096)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2021)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:112)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:118)
INFO|8783/0|Service traccar|18-09-16 20:07:21|  at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:341)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:193)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:428)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:499)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        ... 12 more
FINEST|8783/0|Service traccar|18-09-16 20:07:21|Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost'
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1714)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2190)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2037)
FINEST|8783/0|Service traccar|18-09-16 20:07:21|        ... 28 more
INFO|wrapper|Service traccar|18-09-16 20:07:21|waitpid 8783 59136
INFO|wrapper|Service traccar|18-09-16 20:07:21|exit code posix process: 59136 application(status/signal): 231/0
Anton Tananaev7 years ago

I think the error is pretty clear now:

Access denied for user 'root'@'localhost'

Try this command:

mysql -u root -p --execute="GRANT ALL PRIVILEGES on *.* to 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; FLUSH PRIVILEGES;"

If it doesn't help, you need to research on relevant MySQL resources about the problem.

Kyle7 years ago

Thank you for your help with this. I am going to try this tonight and report back.

Kyle7 years ago

I determined that the problem was me using the wrong password for root. I changed the password with:

mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

Now everything works as expected. Thank you for the assistance and for the hard work on this project!