Getting 500 error while tracking

Hi, We are getting a 500 error when the browser makes a tracking request. The strange things is that once in a while it works fine without the error. We use nginx and there are no errors. We are able to see all requests in the nginx access.log. However the data does not get picked up by Matomo. We use 4.2.1 version of Matomo. Please help.


Don’t you have either an nginx error.log file?
In such case the error will be located there.
Most of the time, few random errors on a huge amount of request can come from:

  • database timeout
  • unexpected parameters in the tracking request (eg. some unrecognized char, wrong siteid, etc.)

Hi Philippe, Thanks for you reply. The nginx error.log file does not have any errors. The nginx log file show all transaction logs. But Matomo UI does not show all the transactions. It shows only a few. Where else can I look for error logs? We have about 1 to 2 website transactions per second.

Don’t yo have also an error log file?
In my configuration, we have an access log file (for all HTTP 2xx) and an error log file (in the same folder - for all HTTP 5xx)

Yes, But the nginx error.log is not reporting any errors. The access.log is capturing all hits. However the data is not showing up in matamo db. This is the issue.

Is there any content in the HTTP 500 response?

No. There is no content in the HTTP 500 response.

I think you missed something somewhere in your configuration, Matomo generates logs in case of HTTP 500

Oh! Can you tell me which config parameter that would be? I will check. Thanks a lot.

I am not expert in Apache/PHP settings, but normally it should trace any HTTP error somewhere.
With no trace, it will be difficult to diagnose anything…

I think i have narrowed the root cause of HTTP 500 error. It is to do with &rec=1 parameter in the POST request. If I remove the rec=1 parameter the problem goes away. Can you let me know how to solve the problem? Thanks a lot.

Hi @SriK,
I read carefully the other topic mentioning the issue you enountered.
It seems you need either:

  • Enable the bcmath PHP module.
  • Or disable the GeoIp2 module (in Matomo administration > System > Plugins)