Called from console, memory 2048M
The periods “day” and “week” went fine. Then the following message was recorded. It’s reproducable.
ERROR CoreConsole[2014-10-24 08:38:52] [b09c8] Got invalid response from API request: http://domain/piwik/index.php?module=API&method=API.get&idSite=1&period=month&date=last52&format=php&token_auth=tokenauth&trigger=archivephp. Response was ’ There is an error. Please report the message (Piwik 2.8.3) and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!). Warning: Error while sending QUERY packet. PID=8115 in /paths/domain/piwik/libs/Zend/Db/Statement/Pdo.php on line 228 Backtrace --> #0 Piwik\Error::errorHandler(…) called at [:] #1 PDOStatement->execute(…) called at [/paths/domain/piwik/libs/Zend/Db/Statement/Pdo.php:228] #2 Zend_Db_Statement_Pdo->_execute(…) called at [/paths/domain/piwik/libs/Zend/Db/Statement.php:300] #3 Zend_Db_Statement->execute(…) called at [/paths/domain/piwik/core/Db/Adapter/Pdo/Mysql.php:230] #4 Piwik\Db\Adapter\Pdo\Mysql->query(…) called at [/paths/domain/piwik/libs/Zend/Db/Adapter/Abstract.php:736] #5 Zend_Db_Adapter_Abstract->fetchAll(…) called at [/paths/domain/piwik/core/Db/Adapter/Pdo/Mysql.php:175] #6 Piwik\Db\Adapter\Pdo\Mysql->isConnectionUTF8(…) called at [/paths/domain/piwik/core/DbHelper.php:121] #7 Piwik\DbHelper::isDatabaseConnectionUTF8(…) called at [/paths/domain/piwik/core/Db/BatchInsert.php:80] #8 Piwik\Db\BatchInsert::tableInsertBatch(…) called at [/paths/domain/piwik/core/DataAccess/ArchiveWriter.php:225] #9 Piwik\DataAccess\ArchiveWriter->insertBulkRecords(…) called at [/paths/domain/piwik/core/DataAccess/ArchiveWriter.php:98] #10 Piwik\DataAccess\ArchiveWriter->insertBlobRecord(…) called at [/paths/domain/piwik/core/ArchiveProcessor.php:334] #11 Piwik\ArchiveProcessor->insertBlobRecord(…) called at [/paths/domain/piwik/core/ArchiveProcessor.php:230] #12 Piwik\ArchiveProcessor->aggregateDataTableRecords(…) called at [/paths/domain/piwik/plugins/Referrers/Archiver.php:220] #13 Piwik\Plugins\Referrers\Archiver->aggregateMultipleReports(…) called at [/paths/domain/piwik/core/ArchiveProcessor/PluginsArchiver.php:102] #14 Piwik\ArchiveProcessor\PluginsArchiver->callAggregateAllPlugins(…) called at [/paths/domain/piwik/core/ArchiveProcessor/Loader.php:122] #15 Piwik\ArchiveProcessor\Loader->prepareAllPluginsArchive(…) called at [/paths/domain/piwik/core/ArchiveProcessor/Loader.php:72] #16 Piwik\ArchiveProcessor\Loader->prepareArchive(…) called at [/paths/domain/piwik/core/Archive.php:801] #17 Piwik\Archive->prepareArchive(…) called at [/paths/domain/piwik/core/Archive.php:614] #18 Piwik\Archive->cacheArchiveIdsAfterLaunching(…) called at [/paths/domain/piwik/core/Archive.php:568] #19 Piwik\Archive->getArchiveIds(…) called at [/paths/domain/piwik/core/Archive.php:508] #20 Piwik\Archive->get(…) called at [/paths/domain/piwik/core/Archive.php:348] #21 Piwik\Archive->getDataTableFromNumeric(…) called at [/paths/domain/piwik/plugins/VisitsSummary/API.php:59] #22 Piwik\Plugins\VisitsSummary\API->get(…) called at [:] #23 call_user_func_array(…) called at [/paths/domain/piwik/core/API/Proxy.php:211] #24 Piwik\API\Proxy->call(…) called at [/paths/domain/piwik/plugins/API/API.php:403] #25 Piwik\Plugins\API\API->get(…) called at [:] #26 call_user_func_array(…) called at [/paths/domain/piwik/core/API/Proxy.php:211] #27 Piwik\API\Proxy->call(…) called at [/paths/domain/piwik/core/API/Request.php:216] #28 Piwik\API\Request->process(…) called at [/paths/domain/piwik/plugins/API/Controller.php:33] #29 Piwik\Plugins\API\Controller->index(…) called at [:] #30 call_user_func_array(…) called at [/paths/domain/piwik/core/FrontController.php:587] #31 Piwik\FrontController->doDispatch(…) called at [/paths/domain/piwik/core/FrontController.php:95] #32 Piwik\FrontController->dispatch(…) called at [/paths/domain/piwik/core/dispatch.php:34] #33 require_once(…) called at [/paths/domain/piwik/index.php:46] #34 require_once(…) called at [/paths/domain/piwik/core/CliMulti/RequestCommand.php:53] #35 Piwik\CliMulti\RequestCommand->execute(…) called at [/paths/domain/piwik/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252] #36 Symfony\Component\Console\Command\Command->run(…) calle
Sorry. More wasn’t there. The next line was:
Archived website id = 1, period = month, 0 visits in last last52 months, 0 visits this month, Time elapsed: 94.154s
ERROR CoreConsole[2014-10-27 14:25:16] [37171] Got invalid response from API request: http://domain/piwik/index.php?module=API&method=API.get&idSite=2&period=day&date=last2&format=php&token_auth=token_auth&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of ‘memory_limit’ in your php.ini file. Please check your Web server Error Log file for more details.
ERROR CoreConsole[2014-10-27 14:25:16] [37171] Empty or invalid response ‘’ for website id 2, Time elapsed: 7.843s, skipping
ERROR CoreConsole[2014-10-27 14:25:23] [37171] 2 total errors during this script execution, please investigate and try and fix these errors.
The last one suggests more memory for PHP. Not sure if you are able to.
I personally use PHP-FPM, with pools. So my piwik pool has a lot of memory, where the other pools have low memory. This way I can give Piwik almost all memory, and my regular website low memory.
On the next run of the cronjob the error message about “memory_limit” didn’t appear anymore. Instead I received the same error message as I wrote in my first post of this thread.
I give PHP 2048M of memory for this and I would be quite surprised if this wouldn’t be enough.
Hi Piwik Team,
I am using PIWIK for last 7 months but I didn’t face a single problem. I love this tool. Thanks a lot. I am also trying to contribute to this tool.
For the past 23 days I am getting this error during the archiving process. OUTPUT:-
ERROR CoreConsole[2014-11-27 11:23:43] [6a516] Got invalid response from API request: Domain.com. Response was ‘a:2:{s:6:“result”;s:5:“error”;s:7:“message”;s:48:“Mysqli prepare error: MySQL server has gone away”;}’
ERROR CoreConsole[2014-11-27 11:50:19] [6a516] Got invalid response from API request: Domain.com. Response was ‘a:2:{s:6:“result”;s:5:“error”;s:7:“message”;s:48:“Mysqli prepare error: MySQL server has gone away”;}’
For this I update the cron time to run every 8 hours from every 2 hours.
I have PHP 5.6+ with memory limit = 3072M
MySQL 5.6+ with innodb memory limit = 7G
Nginx 1.6.1 + PHP-FPM
PIWIK 2.8.3
MySQL timeouts? What are the settings of the /etc/my.cnf file? Could be that Piwik needs more time do its calculation, and that MySQL is closing the connection based on a timeout.
The cron job runs every hour. Yesterday I tried to run the Archiver manually from the console between the cronjobs. This seems to work but the cronjob still does have the timeouts.
I’m waiting for a statement from our hoster to see whether they can change my.cnf.