I see that it is somehow using the h2 database setup, but I removed that from my config file and tried to get it though MariaDB10.
I think I have used up all my brain power for today trying to figure this one out.
Are you following the readme?
https://github.com/traccar/traccar-docker?tab=readme-ov-file#container-create-example
I have, but maybe I am not understanding. Below is my config file. I have replaced config to work with SQL per the instructions, but it just keeps going to h2 database. From my understanding of the instructions, once I have it right, it would kick into the SQL. I have it on port 3306 as that is what MariaDB10 is listening on.
<properties>
<!-- Documentation: https://www.traccar.org/configuration-file/ -->
<entry key="database.driver">com.mysql.cj.jdbc.Driver</entry>
<entry key="database.url">jdbc:mysql://xxx.xxx.xxx.xxx:3306?zeroDateTimeBehavior=round&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key="database.user">traccar</entry>
<entry key="database.password">*************</entry>
</properties>
Then my log file shows
2024-07-01 05:18:17 INFO: Stopping server...
2024-07-01 05:18:26 INFO: Operating system name: Linux version: 4.4.302+ architecture: amd64
2024-07-01 05:18:26 INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: Alpine version: 11.0.23+9-alpine-r0
2024-07-01 05:18:26 INFO: Memory limit heap: 1024mb non-heap: 0mb
2024-07-01 05:18:26 INFO: Character encoding: UTF-8
2024-07-01 05:18:26 INFO: Version: 6.2
2024-07-01 05:18:26 INFO: Starting server...
2024-07-01 05:18:27 WARN: No systemd support - Unable to load library 'systemd':
Error loading shared library libsystemd.so: No such file or directory
Error loading shared library libsystemd.so: No such file or directory
Native library (linux-x86-64/libsystemd.so) not found in resource path (tracker-server.jar) - UnsatisfiedLinkError (... < TaskHealthCheck:51 < <gener:-1 < *:-1 < ... < ScheduleManager:49 < ...)
2024-07-01 05:18:27 INFO: HikariPool-1 - Starting...
2024-07-01 05:18:28 INFO: HikariPool-1 - Added connection conn0: url=jdbc:h2:./data/database user=SA
2024-07-01 05:18:28 INFO: HikariPool-1 - Start completed.
2024-07-01 05:18:28 INFO: Set default schema name to PUBLIC
2024-07-01 05:18:28 INFO: Clearing database change log checksums
2024-07-01 05:18:28 INFO: Successfully acquired change log lock
2024-07-01 05:18:28 INFO: Successfully released change log lock
2024-07-01 05:18:32 INFO: Reading from PUBLIC.DATABASECHANGELOG
2024-07-01 05:18:33 INFO: Reading from PUBLIC.DATABASECHANGELOG
2024-07-01 05:18:33 INFO: Reading from PUBLIC.DATABASECHANGELOG
2024-07-01 05:18:33 INFO: UPDATE SUMMARY
2024-07-01 05:18:33 INFO: Run: 0
2024-07-01 05:18:33 INFO: Previously run: 47
2024-07-01 05:18:33 INFO: Filtered out: 0
2024-07-01 05:18:33 INFO: -------------------------------
2024-07-01 05:18:33 INFO: Total change sets: 47
2024-07-01 05:18:33 INFO: Update summary generated
2024-07-01 05:18:33 INFO: Successfully released change log lock
2024-07-01 05:18:33 INFO: Command execution complete
2024-07-01 05:18:34 WARN: Port disabled due to conflict - Address in use - BindException (...)
2024-07-01 05:18:35 INFO: jetty-11.0.21; built: 2024-05-14T03:19:28.958Z; git: 996cd61addad9cb033e0e3eba6fa3f0fa3dc270d; jvm 11.0.23+9-alpine-r0
2024-07-01 05:18:35 INFO: Started o.t.w.@cc2890b{/,null,AVAILABLE}
2024-07-01 05:18:35 INFO: Session workerName=node0
2024-07-01 05:18:36 WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2024-07-01 05:18:36 INFO: Started o.e.j.s.ServletContextHandler@4b6a3787{/,null,AVAILABLE}
2024-07-01 05:18:36 INFO: Started ServerConnector@125255c7{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2024-07-01 05:18:36 INFO: Started Server@19651c72{STARTING}[11.0.21,sto=0] @11216ms
How did you replace it? I hope you mounted an external file.
I'm not sure what you mean. I took the config file, placed it in the correct location, then pointed my docker container to look at that directory, and then fired up the docker container. Based on the logs, it sees it. Like I said, I'm fresh to docker, but seems like I'm close.
Hi,
I tried using variable environments, which I feel like is getting me closer, as it's not using h2, but the container also won't run. Here is how I setup my variables and the log output. Any ideas? Sorry, I'm just so new at docker containers. If I can't get it, then I can do it on a Windows machine:
2024-07-01 13:37:49 INFO: Operating system name: Linux version: 4.4.302+ architecture: amd64
2024-07-01 13:37:49 INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: Alpine version: 11.0.23+9-alpine-r0
2024-07-01 13:37:49 INFO: Memory limit heap: 1024mb non-heap: 0mb
2024-07-01 13:37:49 INFO: Character encoding: UTF-8
2024-07-01 13:37:49 INFO: Version: 6.2
2024-07-01 13:37:49 INFO: Starting server...
2024-07-01 13:37:50 WARN: No systemd support - Unable to load library 'systemd':
Error loading shared library libsystemd.so: No such file or directory
Error loading shared library libsystemd.so: No such file or directory
Native library (linux-x86-64/libsystemd.so) not found in resource path (tracker-server.jar) - UnsatisfiedLinkError (... < TaskHealthCheck:51 < <gener:-1 < *:-1 < ... < ScheduleManager:49 < ...)
2024-07-01 13:37:50 INFO: HikariPool-1 - Starting...
2024-07-01 13:37:55 ERROR: Main method error - Connection refused (Connection refused) - ConnectException (... < DatabaseModule:80 < <gener:-1 < *:-1 < ... < MainModule:128 < ...)
You should just use the config file. Your folder mapping doesn't make sense though. That's probably the issue. Instead of mapping a single XML file, you're mapping a folder that doesn't exist.
Hi Anton,
I scrapped my old setup and followed this tutorial I found on setting this up via docker container: https://chochol.io/en/software/traccar-docker-installation-guide-on-synology/
The crazy thing is I followed this exactly. Right above step 3, where is says I should be able to launch my traccer login page it will not open and my log file shows the following:
2024-07-02 03:48:08 INFO: HikariPool-1 - Starting...
2024-07-02 03:48:58 INFO: Operating system name: Linux version: 4.4.302+ architecture: amd64
2024-07-02 03:48:58 INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: Alpine version: 11.0.23+9-alpine-r0
2024-07-02 03:48:58 INFO: Memory limit heap: 1024mb non-heap: 0mb
2024-07-02 03:48:58 INFO: Character encoding: UTF-8
2024-07-02 03:48:58 INFO: Version: 6.2
2024-07-02 03:48:58 INFO: Starting server...
2024-07-02 03:48:59 WARN: No systemd support - Unable to load library 'systemd':
Error loading shared library libsystemd.so: No such file or directory
Error loading shared library libsystemd.so: No such file or directory
Native library (linux-x86-64/libsystemd.so) not found in resource path (tracker-server.jar) - UnsatisfiedLinkError (... < TaskHealthCheck:51 < <gener:-1 < *:-1 < ... < ScheduleManager:49 < ...)
2024-07-02 03:48:59 INFO: HikariPool-1 - Starting...
Hi,
I have Traccar working on a Synology NAS via a Docker container. Here is my question - I wanted this to be setup to use MariaDB10 as my database and phpmyadmin. After spending some time getting the docker container figured out, I created my traccar config file (with relevant data shown as image). I then ran my container, and I can see in the logs it created tables and that things are functioning. I even fired up the login page for traccer, logged in just fine and connected GPS's, which are all working, but my problem is there are no tables in MariaDB10, so it's clearly bypassing the MariaDB10 and creating and storing data somewhere else, and I don't understand. I'm glad it's working, but I also need to be able to understand what is happening so that I can make backups of my database.
Anyone have any ideas where I may have gone wrong? I also included a snip of my log file, showing things are working. I will admit, I'm newer to docker containers and I don't know entirely what I am doing, so I have struggled my way in setting up this, but it's working. I just want it to create my database tables in MariaDB10.