Centos 8 w 10.5.8-MariaDB MariaDB Server Installation failure

steve4 years ago

I am looking for a tutorial for Centos 8 using MySQL for Traccar. I found one and believe I have it set up per the instructions I have found but it is failing to create the database tables in Mariadb with the following error.

Also, I would like to take a raspberry pi, install Traccar on it and use it as a client to report to this server I am trying to set up on Centos 8.

Any help would be appreciated.
TIA

liquibase.exception.DatabaseException: CREATE command denied to user 'traccar'@'localhost' for table 'DATABASECHANGELOGLOCK' [Failed SQL: (1142)
steve4 years ago

Also, I did not install HTTP on this server, do I need to? I didn't see that in the tutorial.

Anton Tananaev4 years ago

You don't need HTTP server. Traccar has embedded one.

As for your error, I think it's pretty self-explanatory.

Tony Shelver4 years ago

Not a MySQL expert, but that looks like a user permissions error. Googling it seems to point to user permissions.

Try to create a table directly in the DB using the same user account, and see if you get the same error.

steve4 years ago

Thanks for the help so far. I did reset the password for the user I assigned. I logged in with that user and password to ensure that it did work. I restarted Traccar and then checked to see if the tables were created. They were created. Thanks very much for the help. I really appreciate it.
I definitely made progress but I have another issue that I don't know what it means:

 traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2020-12-11 11:33:17 EST; 1s ago
  Process: 2870 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=1/FAILURE)
 Main PID: 2870 (code=exited, status=1/FAILURE)

Dec 11 11:33:17 chi systemd[1]: traccar.service: Main process exited, code=exited, status=1/FAILURE
Dec 11 11:33:17 chi systemd[1]: traccar.service: Failed with result 'exit-code'.

Am I missing java or something related. Could someone tell me how to install it? I apologize for not knowing, I am learning but lack the knowledge on how to get the next step going. Thanks again and thanks for being patient.

Thanks for the help on if I should install http or not. If I did want to install http for another application with that interfere with Traccar or is it independent of a install of http?

This is pretty cool, making progress with your help.

steve4 years ago

BTW, this is what is install as far as java goes presently:

java-11-openjdk-headless-11.0.9.11-2.el8_3.x86_64
javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch
java-11-openjdk-devel-11.0.9.11-2.el8_3.x86_64
tzdata-java-2020d-1.el8.noarch
java-11-openjdk-11.0.9.11-2.el8_3.x86_64
Anton Tananaev4 years ago

You have to check logs for the error. What you provided doesn't actually provide any useful information.

If there's nothing in the log, it probably means that you have invalid config.

steve4 years ago

Here is what I found which doesn't mean anything to me:

Dec 11 13:06:46 chi traccar[9449]: Exception in thread "main" java.lang.RuntimeException: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Dec 11 13:06:46 chi traccar[9449]: #011at org.traccar.Main.run(Main.java:165)
Dec 11 13:06:46 chi traccar[9449]: #011at org.traccar.Main.main(Main.java:110)
Dec 11 13:06:46 chi traccar[9449]: Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:595)
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:581)
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
Dec 11 13:06:46 chi traccar[9449]: #011at org.traccar.database.DataManager.initDatabase(DataManager.java:139)
Dec 11 13:06:46 chi traccar[9449]: #011at org.traccar.database.DataManager.<init>(DataManager.java:89)
Dec 11 13:06:46 chi traccar[9449]: #011at org.traccar.Context.init(Context.java:299)
Dec 11 13:06:46 chi traccar[9449]: #011at org.traccar.Main.run(Main.java:137)
Dec 11 13:06:46 chi traccar[9449]: #011... 1 more
Dec 11 13:06:46 chi traccar[9449]: Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:358)
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:477)
Dec 11 13:06:46 chi traccar[9449]: #011at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:560)
Dec 11 13:06:46 chi traccar[9449]: #011... 7 more
Dec 11 13:06:46 chi traccar[9449]: Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'traccar'@'localhost' to database 'traccar'
Dec 11 13:06:46 chi traccar[9449]: #011at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Dec 11 13:06:46 chi traccar[9449]: #011at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
Dec 11 13:06:46 chi traccar[9449]: #011at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
Dec 11 13:06:46 chi traccar[9449]: #011at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:792)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:717)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:685)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:134)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:469)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:174)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1348)
Dec 11 13:06:46 chi traccar[9449]: #011at com.mysql.cj.NativeSession.connect(NativeSession.java:157)
steve4 years ago

Here is my config from /opt/traccar/conf/traccar.xml

<?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.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://localhost:3306/traccar?serverTimezone=America/New_York&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'>traccar</entry>
<entry key='database.password'>MyPassword</entry>
</properties>
Anton Tananaev4 years ago

The issue is still the same. MySQL rejects the access:

Access denied for user 'traccar'@'localhost' to database 'traccar'
steve4 years ago

Ok, I rechecked and found an issue with the login. I now can login into traccar and verify the tables are there. When I try and login (http://ipoftraccar.dom:8082) I get "This site can’t be reached" "ipoftraccar.dom refused to connect" Traccar is running now:

traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-12-11 13:32:38 EST; 2min 17s ago
 Main PID: 747 (java)
    Tasks: 14 (limit: 11435)
   Memory: 135.0M
   CGroup: /system.slice/traccar.service
           └─747 /opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
steve4 years ago

This is from my log now:

Dec 11 14:00:57 chi systemd[1]: Stopping traccar...
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 23 [Warning] Aborted connection 23 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 22 [Warning] Aborted connection 22 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 21 [Warning] Aborted connection 21 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 20 [Warning] Aborted connection 20 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 19 [Warning] Aborted connection 19 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 18 [Warning] Aborted connection 18 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 24 [Warning] Aborted connection 24 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 17 [Warning] Aborted connection 17 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 16 [Warning] Aborted connection 16 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 15 [Warning] Aborted connection 15 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14:00:57 chi mariadbd[797]: 2020-12-11 14:00:57 14 [Warning] Aborted connection 14 to db: 'traccar' user: 'traccar' host: 'localhost' (Got an error reading communication packets)
Dec 11 14
steve4 years ago

I am going to completely rebuild the server and start over