telegram support

Lummi2 days ago

when I try to enable telegram support in the traccar.xml file I get an error on startup:

friend@linux:~/traccar$ sudo docker compose up
[+] Running 3/3
 ✔ Container traccar-autoheal-1  Created                                                                                                                           0.1s
 ✔ Container traccar-database-1  Created                                                                                                                           0.1s
 ✔ Container traccar-traccar-1   Created                                                                                                                           0.0s
Attaching to autoheal-1, database-1, traccar-1
autoheal-1  | AUTOHEAL_CONTAINER_LABEL=all
autoheal-1  | AUTOHEAL_START_PERIOD=3600
autoheal-1  | AUTOHEAL_INTERVAL=60
autoheal-1  | AUTOHEAL_DEFAULT_STOP_TIMEOUT=10
autoheal-1  | AUTOHEAL_ONLY_MONITOR_RUNNING=false
autoheal-1  | Monitoring containers for unhealthy status in 3600 second(s)
database-1  | 2025-09-16 02:49:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.6-1.el9 started.
database-1  | 2025-09-16 02:49:02+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
database-1  | 2025-09-16 02:49:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.6-1.el9 started.
database-1  | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
database-1  | 2025-09-16T02:49:03.653405Z 0 [System] [MY-015015] [Server] MySQL Server - start.
database-1  | 2025-09-16T02:49:04.082180Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.6) starting as process 1
database-1  | 2025-09-16T02:49:04.096393Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
traccar-1   | 2025-09-16 02:49:04 ERROR: Main method error -  - SAXParseException (... < Config:45 < <gener:-1 < *:-1 < ... < Main:117 < *:111)
database-1  | 2025-09-16T02:49:04.816426Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
traccar-1 exited with code 1
database-1  | 2025-09-16T02:49:05.407677Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
database-1  | 2025-09-16T02:49:05.407759Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
database-1  | 2025-09-16T02:49:05.412571Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
database-1  | 2025-09-16T02:49:05.488573Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
database-1  | 2025-09-16T02:49:05.488659Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.6'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
traccar-1 exited with code 1
traccar-1 exited with code 1

the config file with key and chatid redacted:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
<properties>

    <!-- Documentation: https://www.traccar.org/configuration-file/ -->

    <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>

</properties>

<entry key='notificator.types'>telegram</entry>
<entry key='notificator.telegram.key'>redacted</entry>
<entry key='notificator.telegram.chatId'>redacted</entry>
Anton Tananaev2 days ago

Do you see anything different between how database properties are defined and your telegram stuff is defined?

Lummi2 days ago

ah yes, looks like those should be within the properties tag. thanks!

Lummi2 days ago

While telegram notifications are working now. I notice that the web notification channel is now missing from the notifications. How do I add it back?
Untitled.png

Anton Tananaev2 days ago

That's because you set types to "telegram" only.

Sebastian2 days ago

You only enabled telegram:

<entry key='notificator.types'>telegram</entry>

try:

<entry key='notificator.types'>telegram,web</entry>