Erreur forward URL

hass2 months ago

Hi ,

I tried to use "event.forward.enable" and "event.forward.url", I put these lines in the 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'>org.h2.Driver</entry>
    <entry key='database.url'>jdbc:h2:./data/database</entry>
    <entry key='database.user'>sa</entry>
    <entry key='database.password'></entry>

    <entry key='event.forward.enable'>true</entry>
    <entry key='event.forward.url'>https://transport.menatours.com/public/api/gps-data</entry>
    <entry key='event.forward.header'> Type de contenu : application/json ; jeu de caractéres = utf-8 </entry>

</properties>

in the traccar log I have this

2024-10-02 11:00:55 WARN: Event forwarding failed - HTTP code 400 - RuntimeException (EventForwarderJson:57 < *:50 < ...)

And I created a listener in symfony to read anything and store it in a database. I checked using postman and it works fine.

But when I run traccar, I don't read any events (in my symfony log).

Any help will be appreciated.

Anton Tananaev2 months ago

Error 400 means your server doesn't like the request for some reason. You have to check why.

hass2 months ago

the configuration in traccar.xml is correct? normally with this traccar sends the data in json form normally?

because on the server side I received the null data

Anton Tananaev2 months ago

The header doesn't make sense to me, but the rest is correct.

hass2 months ago

Are there any specific configurations for the server to accept requests sent by traccar?

Anton Tananaev2 months ago

That's a question to the server you're using. It has nothing to do with Traccar.

hass2 months ago

okay I will see thanks