@fdellwing opened this Issue on June 6th 2019 Contributor

We often have users on the forum that have some problem with the cron archiving.

Currently, the achiever tries to parse the response and fails. It then produces this two lines:

Jun 06 10:00:10 matomo matomo-console[871]: WARNING [2019-06-06 08:00:10] 871  /nix/store/5yq6hsmabykncchhxh44ay25nql87z4h-matomo-3.9.1/share/core/Common.php(271): Notice - unserialize(): Error at offset 0 of 295 bytes - Matomo 3.9.1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
Jun 06 10:00:10 matomo matomo-console[871]: ERROR [2019-06-06 08:00:10] 871  Empty or invalid response 'Got invalid response from API request: https://matomo.matomo?module=API&method=API.get&idSite=1&period=day&date=last6&format=php&trigger=archivephp&token_auth=removed. Response was 'curl_exec: Could not resolve host: matomo.matomo. Hostname requested was: matomo.matomo'' for website id 1, Time elapsed: 0.307s, skipping

If you know where to look, you are easily able to find the reason for the error curl_exec: Could not resolve host: matomo.matomo. Hostname requested was: matomo.matomo. But for a user using this the first time, this is hard to spot.

Another example for such an error message would be:

a:2:{s:6:"result";s:5:"error";s:7:"message";s:427:"SQLSTATE[42000]: Syntax error or access violation: 1064 Routing query to backend failed. See the error log for further details. - in plugin Actions, caused by: SQLSTATE[42000]: Syntax error or access violation: 1064 Routing query to backend failed. See the error log for further details., caused by: SQLSTATE[42000]: Syntax error or access violation: 1064 Routing query to backend failed. See the error log for further details.";}

Again preceded by ERROR [2019-03-19 14:58:46] 17845 Got invalid response from API request: ?module=API&method=API.get&idSite=52&period=day&date=last52&format=php&trigger=archivephp. Response was and on most devices out of sight of the user to the right.

It would be better to really print out what the error was, even on a new line.

Jun 06 10:00:10 matomo matomo-console[871]: ERROR [2019-06-06 08:00:10] 871  Empty or invalid response 'Got invalid response from API request: https://matomo.matomo?module=API&method=API.get&idSite=1&period=day&date=last6&format=php&trigger=archivephp&token_auth=removed.

Response was 'curl_exec: Could not resolve host: matomo.matomo. Hostname requested was: matomo.matomo'

' for website id 1, Time elapsed: 0.307s, skipping
Powered by GitHub Issue Mirror