Got invalid response from API request - Error at offset 0 of 295 bytes

matomo-archive-processing.service failed with this error:

-- Reboot --
Jun 06 10:00:09 matomo systemd[1]: Starting Archive Matomo reports...
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  ---------------------------
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  INIT
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  Running Matomo 3.9.1 as Super User
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  ---------------------------
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  NOTES
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - If you execute this script at least once per hour (or more often) in a crontab, you may disable 'Browser trigger archiving' in Matomo UI > Settings > General Settings.
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871    See the doc at: https://matomo.org/docs/setup-auto-archiving/
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - Reports for today will be processed at most every 900 seconds. You can change this value in Matomo UI > Settings > General Settings.
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - Reports for the current week/month/year will be requested at most every 3600 seconds.
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - Archiving was last executed without error 3 days 11 hours ago
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - Will process 3 other websites because the last time they were archived was on a different day (in the website's timezone) , IDs: 1, 2, 3
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - Will process 1 other websites because some old data reports have been invalidated (eg. using the Log Import script or the InvalidateReports plugin) , IDs: 1
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  ---------------------------
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  START
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  Starting Matomo reports archiving...
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  Day has finished for website id 1 since last run
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  Will pre-process for website id = 1, period = day, date = last6
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - pre-processing all visits
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
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  Day has finished for website id 2 since last run
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  Will pre-process for website id = 2, period = day, date = last5
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - pre-processing all visits
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=2&period=day&date=last5&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 2, Time elapsed: 0.294s, skipping
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  Day has finished for website id 3 since last run
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  Will pre-process for website id = 3, period = day, date = last2
Jun 06 10:00:10 matomo matomo-console[871]: INFO [2019-06-06 08:00:10] 871  - pre-processing all visits
Jun 06 10:00:11 matomo matomo-console[871]: WARNING [2019-06-06 08:00:11] 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:11 matomo matomo-console[871]: ERROR [2019-06-06 08:00:11] 871  Empty or invalid response 'Got invalid response from API request: https://matomo.matomo?module=API&method=API.get&idSite=3&period=day&date=last2&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 3, Time elapsed: 0.287s, skipping
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Done archiving!
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  ---------------------------
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  SUMMARY
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Total visits for today across archived websites: 0
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Archived today's reports for 0 websites
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Archived week/month/year for 0 websites
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Skipped 3 websites
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  - 0 skipped because no new visit since the last script execution
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  - 0 skipped because existing daily reports are less than 900 seconds old
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  - 0 skipped because existing week/month/year periods reports are less than 3600 seconds old
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  - 3 skipped because got an error while querying reporting API
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Total API requests: 0
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  done: 0/3 0%, 0 vtoday, 0 wtoday, 0 wperiods, 0 req, 911 ms, 3 errors.
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Time elapsed: 0.911s
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  ---------------------------
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  SCHEDULED TASKS
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Starting Scheduled tasks...
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Scheduler: executing task Piwik\Plugins\ExamplePlugin\Tasks.myTask...
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Scheduler: finished. Time elapsed: 0.000s
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Scheduler: executing task Piwik\Plugins\CustomPiwikJs\Tasks.updateTracker...
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Scheduler: finished. Time elapsed: 0.003s
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Scheduler: executing task Piwik\Plugins\PrivacyManager\Tasks.deleteLogData...
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Scheduler: finished. Time elapsed: 0.006s
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Scheduler: executing task Piwik\Plugins\PrivacyManager\Tasks.anonymizePastData...
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Scheduler: finished. Time elapsed: 0.002s
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  done
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  ---------------------------
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  ---------------------------
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  SUMMARY OF ERRORS
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Error: 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
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Error: Empty or invalid response 'Got invalid response from API request: https://matomo.matomo?module=API&method=API.get&idSite=2&period=day&date=last5&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 2, Time elapsed: 0.294s, skipping
Jun 06 10:00:11 matomo matomo-console[871]: INFO [2019-06-06 08:00:11] 871  Error: Empty or invalid response 'Got invalid response from API request: https://matomo.matomo?module=API&method=API.get&idSite=3&period=day&date=last2&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 3, Time elapsed: 0.287s, skipping
Jun 06 10:00:11 matomo matomo-console[871]: ERROR [2019-06-06 08:00:11] 871  3 total errors during this script execution, please investigate and try and fix these errors.
Jun 06 10:00:11 matomo matomo-console[871]:                                                                                                  
Jun 06 10:00:11 matomo matomo-console[871]:   [Exception]
Jun 06 10:00:11 matomo matomo-console[871]:   3 total errors during this script execution, please investigate and try and fix these errors.
Jun 06 10:00:11 matomo matomo-console[871]:                                                                                                  
Jun 06 10:00:11 matomo matomo-console[871]: core:archive [--url="..."] [--force-all-websites] [--force-all-periods[="..."]] [--force-timeout-for-periods[="..."]] [--skip-idsites[="..."]] [--skip-all-segments] [--force-idsites[="..."]] [--force-periods[="..."]] [--force-date-last-n="..."] [--force-date-range[="..."]] [--force-idsegments="..."] [--concurrent-requests-per-website[="..."]] [--concurrent-archivers[="..."]] [--disable-scheduled-tasks] [--accept-invalid-ssl-certificate] [--php-cli-options[="..."]]
Jun 06 10:00:11 matomo systemd[1]: matomo-archive-processing.service: Main process exited, code=exited, status=1/FAILURE
Jun 06 10:00:11 matomo systemd[1]: matomo-archive-processing.service: Failed with result 'exit-code'.
Jun 06 10:00:11 matomo systemd[1]: Failed to start Archive Matomo reports.


Matomo 3.9.1
Installed according to this manual

Not a Matomo bug, the error message shows a local configuration error on your site.

curl_exec: Could not resolve host: matomo.matomo.
1 Like

Do you have any idea from which configuration strange hostname “matomo.matomo” comes from?

What is the exact command you use to start the archiving?

1 Like