Auto-Archiving Got invalid response from API request


(rujiaxiao) #1

i got a error when i set a auto archiving to a site which has 1million action every day ?how to solve this error?
sometimes it would work if i set --force-date-last-n=1 ,but sometimes it doesn’t work .
this is the achiving response:
INFO [2018-06-27 07:18:34] 18572 ---------------------------
INFO [2018-06-27 07:18:34] 18572 INIT
INFO [2018-06-27 07:18:34] 18572 Running Matomo 3.5.1 as Super User
INFO [2018-06-27 07:18:34] 18572 ---------------------------
INFO [2018-06-27 07:18:34] 18572 NOTES
INFO [2018-06-27 07:18:34] 18572 - Reports for today will be processed at most every 3600 seconds. You can change this value in Matomo UI > Settings > General Settings.
INFO [2018-06-27 07:18:34] 18572 - Reports for the current week/month/year will be requested at most every 3600 seconds.
INFO [2018-06-27 07:18:34] 18572 - Archiving was last executed without error 2 小时 15 分 ago
INFO [2018-06-27 07:18:34] 18572 - Will process 1 websites (–force-idsites)
INFO [2018-06-27 07:18:34] 18572 ---------------------------
INFO [2018-06-27 07:18:34] 18572 START
INFO [2018-06-27 07:18:34] 18572 Starting Matomo reports archiving…
INFO [2018-06-27 07:18:34] 18572 Will pre-process for website id = 14, period = day, date = last1
INFO [2018-06-27 07:18:34] 18572 - pre-processing all visits
ERROR [2018-06-27 07:19:38] 18572 Got invalid response from API request: ?module=API&method=API.get&idSite=14&period=day&date=last1&format=php&trigger=archivephp. Response was ’ 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.


ERROR [2018-06-27 07:19:38] 18572 Empty or invalid response ‘’ for website id 14, Time elapsed: 64.168s, skipping
INFO [2018-06-27 07:19:38] 18572 Done archiving!
INFO [2018-06-27 07:19:38] 18572 ---------------------------
INFO [2018-06-27 07:19:38] 18572 SUMMARY
INFO [2018-06-27 07:19:38] 18572 Total visits for today across archived websites: 0
INFO [2018-06-27 07:19:38] 18572 Archived today’s reports for 0 websites
INFO [2018-06-27 07:19:38] 18572 Archived week/month/year for 0 websites
INFO [2018-06-27 07:19:38] 18572 Skipped 17 websites
INFO [2018-06-27 07:19:38] 18572 - 0 skipped because no new visit since the last script execution
INFO [2018-06-27 07:19:38] 18572 - 0 skipped because existing daily reports are less than 3600 seconds old
INFO [2018-06-27 07:19:38] 18572 - 0 skipped because existing week/month/year periods reports are less than 3600 seconds old
INFO [2018-06-27 07:19:38] 18572 - 1 skipped because got an error while querying reporting API
INFO [2018-06-27 07:19:38] 18572 Total API requests: 0
INFO [2018-06-27 07:19:38] 18572 done: 0/1 0%, 0 vtoday, 0 wtoday, 0 wperiods, 0 req, 64206 ms, 2 errors.
INFO [2018-06-27 07:19:38] 18572 Time elapsed: 64.207s
INFO [2018-06-27 07:19:38] 18572 ---------------------------
INFO [2018-06-27 07:19:38] 18572 SCHEDULED TASKS
INFO [2018-06-27 07:19:38] 18572 Starting Scheduled tasks…
INFO [2018-06-27 07:19:38] 18572 done
INFO [2018-06-27 07:19:38] 18572 ---------------------------
INFO [2018-06-27 07:19:38] 18572 ---------------------------
INFO [2018-06-27 07:19:38] 18572 SUMMARY OF ERRORS
INFO [2018-06-27 07:19:38] 18572 Error: Got invalid response from API request: ?module=API&method=API.get&idSite=14&period=day&date=last1&format=php&trigger=archivephp. Response was ’ 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.


INFO [2018-06-27 07:19:38] 18572 Error: Empty or invalid response ‘’ for website id 14, Time elapsed: 64.168s, skipping
ERROR [2018-06-27 07:19:38] 18572 2 total errors during this script execution, please investigate and try and fix these errors.

(Peterbo) #2

You get a “500 internal server error” message. What is that error? Have a look at the error-logs.


(rujiaxiao) #3

hi perterbo:
More information about this error may be available in the server error log?
How can i enable the log and where the log can be find?


(rujiaxiao) #4

hi perterbo:
i find that the error will be happen when archiving range than 64 second
Empty or invalid response ‘’ for website id 14, Time elapsed: 64.241s, skipping
do matomo have a setting to set up archiving timeout


(Peterbo) #5

You’ll have to find your server error log. This is only the report for the “missing” response. We’ll have to find out why there is no or a faulty response. Contact your hosting provider to find out where your error-log is accessible.


(rujiaxiao) #6

hi peterbo
i find a apache error when i archiving my matomo
[Thu Jun 28 17:47:52.445172 2018] [fcgid:warn] [pid 20632:tid 15900] [client 10.201.1.97:35765] mod_fcgid: read timeout from pipe
[Thu Jun 28 17:47:52.445172 2018] [core:error] [pid 20632:tid 15900] [client 10.201.1.97:35765] End of script output before headers: index.php


(Fabian Dellwing) #7

Your call is processing to long for your PHP settings. Increase these and it should work.


(rujiaxiao) #8

hi Dellwing,how to set it?


(Fabian Dellwing) #9

I cannot answer that without knowing exactly what PHP software you use.


(rujiaxiao) #10

hi Dellwing,i use visualAMP to build up matomo,and my php version is 7.0.13.
Can I add set_time_limit(0); in the index.php file to solve this problem?


(rujiaxiao) #11

hi Dellwing,do you have any process?


(Fabian Dellwing) #12

I have no clue about visualAMP, so I cannot answer that.


(rujiaxiao) #13

I found an apache setting: ’ FcgidIOTimeout 60’ in the ’ httpd-php.conf’ file
after setting its value up, my problem has been solved
thanks fdellwing,thank Peterbo,thanks all