I’m getting the following reply when doing a daily archive
ERROR: Got invalid response from API request: https://example.com/index.php?module=API&method=VisitsSummary.getVisits&idSite=4&period=day&date=last52&format=php&token_auth=xxxx&trigger=archivephp. Response was 'curl_exec: Empty reply from server'
I only archive data on this server daily because it does a import via the log analytics tool, then I run a archive straight away. Is this because Piwik is taking to long to response, IE it’s still doing something? Or some other reason?
Is it possible to set the timeout on the archive script a bit higher to see if that helps? I can’t see any errors in my apache logs or anything, so I assume it’s just because it’s taking longer than the archive script wants.
Nah nothing in the /tmp/logs directory in Piwik nor the apache error log, I guess it’s just taking a really long time making the archive script think it’s erroring, it takes a few time but it eventually manages to run without issue.
The same error occurs in my piwik 2.0.3 installation. The archive script is started by a cron job each night. I played around to start the script at unbusy times. There is always this error message in the morning, send by an email. I can start the script manually and it runs without problems.
I think it happens when piwik takes to long to reply to the archive script, I’ve found that it only happens on two of my websites, both gets lots of traffic and only happens on really busy days.
I’ve checked it’s not my max_execution_time since it’s the cron saying it didn’t get a reply and my error log for apache isn’t saying it’s got a php timeout
I just know to set default_socket_timeout in the php.ini. Unfortunately, I do not know the place in piwik where to give curlopt_timeout a new value, WITHOUT going in the source code - thats why I askes here
There are no specific errors in the php error log file;
/etc/php.ini:
error_reporting = E_ALL
error_log = /srv/www/logs/php_error.log
log_errors = On
grep curl php_error.log and grep archive php_error.log returns no results.
archive.php is called via
0 3 * * * /usr/local/bin/php /srv/www/htdocs/piwik/misc/cron/archive.php --url=http://xxx.de > /home/piwik/logs/piwik-archive.log