Test notifications: MessageBodyReader not found for media type

matli2 years ago

Hi there.

I am running Traccar latest release 5.7 on DigitalOcean Ubuntu. In general the server runs well and is SSL enabled. However, sometimes the notification test returns the following error (randomly). Whereas sometimes the same test results in no error.

MessageBodyReader not found for media type=text/plain;charset=utf-8, type=interface javax.json.JsonObject, genericType=interface javax.json.JsonObject. - MessageBodyProviderNotFoundException (... < NotificatorTraccar:106 < NotificationResource:96 < ...)

Here the notification configuration section:

       
        <!-- Type Notification CONFIG -->
        <entry key='notificator.types'>web,mail,sms,traccar,telegram</entry>

       <!-- Email notification CONFIG -->
        <entry key='mail.smtp.host'>mail.smtp2go.com</entry>
        <entry key='mail.smtp.port'>2525</entry>
        <entry key='mail.smtp.ssl.enable'>false</entry>
        <entry key='mail.smtp.from'>messenger@xxxxx.net</entry>
        <entry key='mail.smtp.auth'>true</entry>
        <entry key='mail.smtp.username'>xxxxxxxxxxxxxxxx</entry>
        <entry key='mail.smtp.password'>xxxxxxxxxxxxxxxx</entry>
        
        
       <!-- TWILIO SMS CONFIG -->
        <entry key='notificator.sms.manager.class'>org.traccar.sms.HttpSmsClient</entry>
        <entry key='sms.http.url'>https://api.twilio.com/2010-04-01/Accounts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/Messages.json</entry>
        <entry key='sms.http.user'>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</entry>
        <entry key='sms.http.password'>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</entry>
        <entry key='sms.http.template'>From=%2B16128888812&amp;To={phone}&amp;Body={message}</entry>
        
        <!-- Telegram CONFIG -->
        <entry key='notificator.telegram.key'>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</entry>
        <entry key='notificator.telegram.chatId'>xxxxxxxxxxxxxxxx</entry>
        <entry key='notificator.telegram.sendLocation'>true</entry>

Note: The xxx is replacing the actual credentials.

This appears to be happening randomly. Any hints? The strange thing is that the Email, Telegram and Twilio SMS are received correctly despite that the error appears.

matli2 years ago

Update: I noticed when I remove notification channel "traccar" from notifications and I test these notifications, then there is no error. The error only appears when channel "traccar" is added to a notification.

Anton Tananaev2 years ago

Could be some temporary issue with our backend.

matli2 years ago

Hi Anton. Thanks for commenting. In case the cause is related to the backend, please let us know once it has been resolved. Appreciated.

Anton Tananaev2 years ago

It should be working now. That's why I said temporary issue. It could be that we were upgrading or deploying something at the time you tested it.

matli2 years ago

Anton, thanks!