Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Archiving issue Archiving last ran successfully on Thursday, May 28, 2020 #16037

Closed
plegault3397 opened this issue Jun 8, 2020 · 7 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@plegault3397
Copy link

plegault3397 commented Jun 8, 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
Copy link
Author

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
Copy link
Member

sgiehl commented Jun 8, 2020

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

@Findus23 Findus23 added the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Jun 8, 2020
@plegault3397
Copy link
Author

plegault3397 commented Jun 9, 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
Copy link
Author

plegault3397 commented Jun 10, 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
Copy link
Author

It's working now.

@plegault3397
Copy link
Author

working

@tsteur tsteur added answered For when a question was asked and we referred to forum or answered it. and removed Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. labels Jun 10, 2020
@tsteur
Copy link
Member

tsteur commented Jun 10, 2020

Glad it works now @plegault3397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

4 participants