CIP values provokes "400, reason phrase: Bad Request" error

Hi Lukas,

Many thanks for your feedback.
Well I didn’t manage to get the person in charge of the matomo server to update the config to turn on the debug mode but after 2 couple of hours working with him we found out the root cause of this issue that i’d like to share for the sake of the Matomo user community.
The trick was that for some reason the token_auth value that was set once upon a time by the person who implemented initially the web analytics reporting on our web services was actually linked to a read only user.
The Matomo doc (https://developer.matomo.org/api-reference/tracking-api) explicitly indicate the optional CIP parameter “requires authentication via token_auth )”.

Now in case, the request was sent with CIP = null, it would disregard the auth_token value as it would consider it as not required, but if a value was assigned to the CIP parameter like CIP = 192.168.1.5 then it would check it …and return 400 bad request error :neutral_face: .

So in short, I’m not really sure to understand why in such a case the error message was not more elaborate (for security reason ? ha ha ha) but this was a hard one to find out and I hope my finding may help others in the future.

Cheers.