@plegault3397 opened this Issue on June 8th 2020

Archiving last ran successfully on Thursday, May 28, 2020 16:06:19 which is 10 days 18:43:46 ago.
This err started around the time I updated to Matomo 3.13.5. I recently updated Matomo 3.13.6 and still have the issue

ERROR [2020-06-08 11:12:29] 13776  Got invalid response from API request: ?module=API&method=API.get&idSite=6&period=day&date=last12&format=php&trigger=archivephp. Response was '<?php  use Piwik\FrontController;  if (!defined('PIWIK_DOCUMENT_ROOT')) {     define('PIWIK_D
OCUMENT_ROOT', dirname(__FILE__) == '/' ? '' : dirname(__FILE__)); }  if (file_exists(PIWIK_DOCUMENT_ROOT . '/bootstrap.php')) {     require_once PIWIK_DOCUMENT_ROOT . '/bootstrap.php'; }  if (!defined('PIWIK_INCLUDE_PATH')) {     define('PIWIK_INCLUDE_PATH', PIWIK_DOCUM
ENT_ROOT); }  require_once PIWIK_INCLUDE_PATH . '/core/bootstrap.php';  if (!Piwik\Common::isPhpCliMode()) {     exit; }  if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) {     Piwik\ErrorHandler::registerErrorHandler();     Piwik\ExceptionHandle
r::setUp(); }  FrontController::setUpSafeMode();  $console = new Piwik\Console(); $console->run();'
ERROR [2020-06-08 11:12:29] 13776  Empty or invalid response '' for website id 6, Time elapsed: 0.316s, skipping
INFO [2020-06-08 11:12:29] 13776  Day has finished for website id 7 since last run
INFO [2020-06-08 11:12:29] 13776  Will pre-process for website id = 7, period = day, date = last2
INFO [2020-06-08 11:12:29] 13776  - pre-processing all visits
@plegault3397 commented on June 8th 2020

I'm able to run the archive on the Linux server. I'm not able to get it running on the windows 2016 server. I'm using the Bitnami WAMP. I have reinstalled it several time, with different versions. non seem to work.

@sgiehl commented on June 8th 2020 Member

@plegault3397 Based on the response it seems your server did not parse the PHP code, but returned the contents instead 🤔

@plegault3397 commented on June 9th 2020

Everything is working except for archiving. if there where php issues wouldn't I have more issues than archiving?
btw I'm running on windows 2016 server, PHP Version 7.3.17, Bitnami Matomo 3.13.6

I'm using --accept-invalid-ssl-certificate because of a self signed certificate.
I added
custom_cacert_pem = "https://server.com/core/datafiles/server.pem" to the config file
and to the php.ini
curl.cainfo = "D:\Bitnami\matomo\apache2\conf\server.pem"

No good still get error for cert

this is the error now.

ERROR [2020-06-09 19:29:28] 4536  Got invalid response from API request: ?module=API&method=API.get&idSite=6&period=day&date=last2&format=php&trigger=archivephp. Response was 'Got invalid response from API request: https://server.com/console?module=API&method=A
PI.get&idSite=6&period=day&date=last2&format=php&trigger=archivephp&token_auth=removed. Response was 'curl_exec: error setting certificate verify locations:   CAfile: https://server.com/core/datafiles/server.pem   CApath: none. Hostname requested was: server.com''
ERROR [2020-06-09 19:29:28] 4536  Empty or invalid response '' for website id 6, Time elapsed: 0.291s, skipping

looking into the the settings file I see

Error: curl_exec: error setting certificate verify locations: CAfile: https://server.com/core/datafiles/server.pem CApath: none. Hostname requested was: plugins.matomo.org

in the check setting everything is green except 2 warnings.
Geolocation
file integrity
Files were found in your Matomo, but we didn't expect them.
--> Please delete these files to prevent errors. <--

File to delete: config/IntranetGeoIP.data.php
File to delete: config/IntranetGeoIP.data.php.old
File to delete: core/DataFiles/server.pem

if I add --accept-invalid-ssl-certificate

ERROR [2020-06-09 21:23:31] 5436 Got invalid response from API request: ?module=API&method=API.get&idSite=29&period=day&date=last2&format=php&trigger=archivephp. Response was '<?php use Piwik\FrontController; if (!defined('PIWIK_DOCUMENT_ROOT')) { define('PIWIK_DO CUMENT_ROOT', dirname(__FILE__) == '/' ? '' : dirname(__FILE__)); } if (file_exists(PIWIK_DOCUMENT_ROOT . '/bootstrap.php')) { require_once PIWIK_DOCUMENT_ROOT . '/bootstrap.php'; } if (!defined('PIWIK_INCLUDE_PATH')) { define('PIWIK_INCLUDE_PATH', PIWIK_DOCUME NT_ROOT); } require_once PIWIK_INCLUDE_PATH . '/core/bootstrap.php'; if (!Piwik\Common::isPhpCliMode()) { exit; } if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) { Piwik\ErrorHandler::registerErrorHandler(); Piwik\ExceptionHandler ::setUp(); } FrontController::setUpSafeMode(); $console = new Piwik\Console(); $console->run();'

@plegault3397 commented on June 10th 2020

I ran the archiving command like
php "D:\Bitnami\matomo\apps\matomo\htdocs\console" core:archive --url=https://server.com/console --verbose --force-all-websites --accept-invalid-ssl-certificate

and get the following

DEBUG [2020-06-10 10:27:14] 3740  Execute HTTP API request: https://server.com/console?module=API&method=API.get&idSite=6&period=day&date=last52&format=php&trigger=archivephp&token_auth=removed
ERROR [2020-06-10 10:27:14] 3740  Got invalid response from API request: ?module=API&method=API.get&idSite=6&period=day&date=last52&format=php&trigger=archivephp. Response was '<?php  use Piwik\FrontController;  if (!defined('PIWIK_DOCUMENT_ROOT')) {     define('PIWIK_DO
CUMENT_ROOT', dirname(__FILE__) == '/' ? '' : dirname(__FILE__)); }  if (file_exists(PIWIK_DOCUMENT_ROOT . '/bootstrap.php')) {     require_once PIWIK_DOCUMENT_ROOT . '/bootstrap.php'; }  if (!defined('PIWIK_INCLUDE_PATH')) {     define('PIWIK_INCLUDE_PATH', PIWIK_DOCUME
NT_ROOT); }  require_once PIWIK_INCLUDE_PATH . '/core/bootstrap.php';  if (!Piwik\Common::isPhpCliMode()) {     exit; }  if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) {     Piwik\ErrorHandler::registerErrorHandler();     Piwik\ExceptionHandler
::setUp(); }  FrontController::setUpSafeMode();  $console = new Piwik\Console(); $console->run();'
ERROR [2020-06-10 10:27:14] 3740  Empty or invalid response '' for website id 6, Time elapsed: 0.322s, skipping
INFO [2020-06-10 10:27:14] 3740  Will pre-process for website id = 7, period = day, date = last2
INFO [2020-06-10 10:27:14] 3740  - pre-processing all visits

and

Exception trace:
 () at D:\Bitnami\matomo\apps\matomo\htdocs\core\CronArchive.php:606
 Piwik\CronArchive->logFatalError() at D:\Bitnami\matomo\apps\matomo\htdocs\core\CronArchive.php:599
 Piwik\CronArchive->end() at D:\Bitnami\matomo\apps\matomo\htdocs\core\CronArchive.php:331
 Piwik\CronArchive->Piwik\{closure}() at D:\Bitnami\matomo\apps\matomo\htdocs\core\Access.php:635
 Piwik\Access::doAsSuperUser() at D:\Bitnami\matomo\apps\matomo\htdocs\core\CronArchive.php:335
 Piwik\CronArchive->main() at D:\Bitnami\matomo\apps\matomo\htdocs\plugins\CoreConsole\Commands\CoreArchiver.php:27
 Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute() at D:\Bitnami\matomo\apps\matomo\htdocs\vendor\symfony\console\Symfony\Component\Console\Command\Command.php:257
 Symfony\Component\Console\Command\Command->run() at D:\Bitnami\matomo\apps\matomo\htdocs\vendor\symfony\console\Symfony\Component\Console\Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at D:\Bitnami\matomo\apps\matomo\htdocs\vendor\symfony\console\Symfony\Component\Console\Application.php:195
 Symfony\Component\Console\Application->doRun() at n/a:n/a
 call_user_func() at D:\Bitnami\matomo\apps\matomo\htdocs\core\Console.php:140
 Piwik\Console->Piwik\{closure}() at D:\Bitnami\matomo\apps\matomo\htdocs\core\Access.php:644
 Piwik\Access::doAsSuperUser() at D:\Bitnami\matomo\apps\matomo\htdocs\core\Console.php:141
 Piwik\Console->doRunImpl() at D:\Bitnami\matomo\apps\matomo\htdocs\core\Console.php:93
 Piwik\Console->doRun() at D:\Bitnami\matomo\apps\matomo\htdocs\vendor\symfony\console\Symfony\Component\Console\Application.php:126
 Symfony\Component\Console\Application->run() at D:\Bitnami\matomo\apps\matomo\htdocs\console:32

I also tried
https://matomo.your-server.example/path/to/matomo/misc/cron/archive.php?token_auth=XYZ --verbose --force-all-websites --accept-invalid-ssl-certificate
same debug

@plegault3397 commented on June 10th 2020

It's working now.

@plegault3397 commented on June 10th 2020

working

@tsteur commented on June 10th 2020 Member

Glad it works now @plegault3397

This Issue was closed on June 10th 2020
Powered by GitHub Issue Mirror