@anonymous-piwik-user opened this Issue on May 25th 2013

There is non critical bug in data re-processing with archive.php. Here is detailed description:

1.) Small site in total: 10K visitors/day ; 5 web sites; 15 months of piwik logs,
2.) Noticed behavior in 1.12-b19 and 1.12-b20.
3.) Use mysql and drop all piwikarchive* tables ;
4.) Setup periodically archiving with cron and misc/cron/archive.php and redirect output to piwik.log.
5.) Setup one pre-processed segment : referrerType==direct
5.) In piwik.log you will notice following error(s):

17:53:49 [f188d4fd] Error: Got invalid response from API request: http://piwik.###############/index.php?module=API&method=VisitsSummary.getVisits&idSite=4&period=year&date=last2&format=php&token_auth=################################&trigger=archivephp. Response was '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title> </head><body> <h1>Internal Server Error</h1> <p>The se
17:53:49 [f188d4fd] 1 total errors during this script execution, please investigate and try and fix these errors
17:53:49 [f188d4fd] ERROR: 1 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: http://piwik.###############/index.php?module=API&method=VisitsSummary.getVisits&idSite=4&period=year&date=last2&format=php&token_auth=################################&trigger=archivephp. Response was '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title> </head><body> <h1>Internal Server Error</h1> <p>The se

6.) You can resolve this problem if you configure in: "Settings" -> "General Settings" -> "Allow Piwik archiving to trigger when reports are viewed from the browser" to "Yes"
7.) Select "Data range From To" to include complete period from first day to current date and generate "Visitors" -> "Overview" report.
8.) Once you successfully generated "Visitors" -> "Overview" report you can disable browser archiving trigger. There will be no error message in archive.log

REMARKS:
I double check for correct file/user permissions during archive.php execution and they are OK.
Please advice if you need any additional investigation of this problem. It might be also some strange problem with my installation of piwik 1.12.-b20 although I doubt.
My solution works for small web site. For big piwik installation this is not viable solution ...

@anonymous-piwik-user commented on May 25th 2013

I noticed that this error happens with sites which are exclusively for image tracking. Here is function which is used for image only tracking:

function doImgTrack( $log,$ref){
require_once 'PiwikTracker.php';
$t = new PiwikTracker(###,'http://piwik.#################/');
$t->setTokenAuth('############################');
$t->setIp($_SERVER['REMOTE_ADDR']);
$t->setUrl("http://www.##########".$ref);
$t->doTrackPageView($log.'/'.$ref);
};

@mattab commented on May 27th 2013 Owner

What was the error in the web server / apache error log file, when it errors in archive.php? in general the error in the server log file will tell you the cause

This Issue was closed on May 27th 2013
Powered by GitHub Issue Mirror