Push Notification Failure - Server 6.14.4

Gerardo Iscala 25 days ago

Hi everyone, after updating the server, push notifications stopped working. Is anyone else having this problem?

Web notifications are working, but push notifications aren't.

root@ubuntu:/opt/traccar/conf# cat traccar.xml 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
<properties>

    <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost/traccar?zeroDateTimeBehavior=round&amp;serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&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'>user</entry>
    <entry key='database.password'>password</entry>

    <!-- Notification Types -->
    <entry key='notificator.types'>traccar,web,sms,mail,command</entry>
    <entry key='notificator.traccar.key'>api key</entry>

    <!-- SMS Configuration Traccar Gateway -->
    <entry key='notificator.traccar.key'>api key</entry>
    <entry key='sms.http.url'>https://www.traccar.org/sms/</entry>
    <entry key='sms.http.authorization'>api key</entry>
    <entry key='sms.http.template'> 
    {
        "to": "{phone}",
        "message": "{message}"
    }
    </entry>

    <!-- Gmail SMTP Configuration -->
    <entry key='mail.smtp.host'>smtp.gmail.com</entry>
    <entry key='mail.smtp.port'>587</entry>
    <entry key='mail.smtp.auth'>true</entry>    

    <entry key='mail.smtp.starttls.enable'>true</entry>
    <entry key='mail.smtp.starttls.required'>true</entry>   

    <entry key='mail.smtp.from'>email</entry>
    <entry key='mail.smtp.username'>email</entry>
    <entry key='mail.smtp.password'>password</entry>

</properties>
root@ubuntu:/opt/traccar/conf# 

This is my configuration, with its respective API key.

Anton Tananaev 25 days ago

Do you get any errors when you send a test notification?

Gerardo Iscala 25 days ago

I don't receive any errors when running the test notification.

Anton Tananaev 25 days ago

How many tokens do you have in the user attributes?

Gerardo Iscala 25 days ago

I actually reinstalled version 6.14.4 and left the configuration file with only the Traccar API key for push notifications, and it still doesn't work.

Web notifications do work.

root@ubuntu:/opt/traccar/conf# cat traccar.xml 
<?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'>com.mysql.cj.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost/traccar?zeroDateTimeBehavior=round&amp;serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&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'>user</entry>
    <entry key='database.password'>password</entry>

    <entry key='notificator.types'>traccar,web,sms,mail,command</entry>
    <entry key='notificator.traccar.key'>api key traccar</entry>
</properties>
root@ubuntu:/opt/traccar/conf# 
Gerardo Iscala 25 days ago

I have only one notification token stored in the user attributes.

Query used:

SELECT JSON_EXTRACT(attributes, '$.notificationTokens')
FROM tc_users
WHERE id = 1;

Result:

"cNJkunL5SC27maBvSnAjeR:APA91bFN9fo05Ym60aZDnbiDbu..."

The token is also visible in Traccar Manager under Account → Attributes → Notification Tokens.

Push notifications stopped working immediately after upgrading from 6.13.2 to 6.14.4. Web notifications continue to work correctly.

Gerardo Iscala 25 days ago

Push notifications stopped working immediately after upgrading from 6.14.2 to 6.14.4. Web notifications continue to work correctly.

Anton Tananaev 25 days ago

Tokens are comma separated. To be safe I would recommend removing it and logging in again. This will generate a new token.

Gerardo Iscala 25 days ago

I removed the notification token from the database and confirmed that notificationTokens became NULL.

Then I completely uninstalled Traccar Manager, reinstalled it, and logged in again.

The notificationTokens field is still NULL after login. No new token is being generated or stored in the user attributes.

Anton Tananaev 25 days ago

Sounds like that's your real issue.

Gerardo Iscala 25 days ago

Yes, that's correct. I'm using the official Traccar Manager app, and the server is also the official Traccar server; I'm not using anything customized. Both the server and the app are updated to the latest version, but the push notifications still aren't working. I would appreciate any help you can offer. Thank you.

Anton Tananaev 25 days ago

I can reproduce the problem. I will investigate.

Gerardo Iscala 25 days ago

I understand, thank you Anton, I'll keep an eye out for any updates.

Anton Tananaev 25 days ago

The issue should be fixed in 6.14.5.

Gerardo Iscala 25 days ago

I updated to version 6.14.5 and push notifications are working correctly.

Thanks, Anton