@reddipravi opened this Issue on August 20th 2020

While trying to run archive reports using the command line in Matomo, we are facing errors.

command:
php ./htdocs/console core:archive --force-idsites=29 --force-periods=week --url=**

INFO [2020-08-19 22:16:05] 28 NOTES
INFO [2020-08-19 22:16:05] 28 - Async process archiving supported, using CliMulti.
INFO [2020-08-19 22:16:05] 28 - Reports for today will be processed at most every 3600 seconds. You can change this value in Matomo UI > Settings > General Settings.
INFO [2020-08-19 22:16:05] 28 - Reports for the current week/month/year will be requested at most every 3600 seconds.
INFO [2020-08-19 22:16:05] 28 - Will process 1 websites (--force-idsites)
INFO [2020-08-19 22:16:05] 28 ---------------------------
INFO [2020-08-19 22:16:05] 28 START
INFO [2020-08-19 22:16:05] 28 Starting Matomo reports archiving...
INFO [2020-08-19 22:16:06] 28 Will pre-process for website id = 29, period = day, date = last90
INFO [2020-08-19 22:16:06] 28 - pre-processing all visits
] WARNING [2020-08-19 22:18:15] 28 /home/vcap/app/htdocs/core/Common.php(297): Notice - unserialize(): Error at offset 0 of 133333 bytes - Matomo 3.13.5 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
ERROR [2020-08-19 22:18:16] 28 Empty or invalid response '###!/usr/bin/env php
[ERR] a:90:{s:10:"2020-05-22";a:19:{s:35:"Referrers_visitorsFromSearchEngines";i:0;s:36:"Referrers_visitorsFromSocialNetworks";i:0;s:33:"Referrers_visitorsFromDirectEntry";i:0;s:30:"Referrers_visitorsFromWebsites";i:0;s:31:"Referrers_visitorsFromCampaigns";i:0;s:41:"Referrers_visitorsFromDirectEntry_percent";s:2:"0%";s:43:"Referrers_visitorsFromSearchEngines_percent";s:2:"0%";s:39:"Referrers_visitorsFromCampaigns_percent";s:2:"0%";s:44:"Referrers_visitorsFromSocialNetworks_percent";s:2:"0%";s:38:"Referrers_visitorsFromWebsites_percent";s:2:"0%";s:11:"bounce_rate";s:2:"0%";s:20:"nb_actions_per_visit";i:0;s:16:"avg_time_on_site";i:0;s:26:"avg_time_on_site_returning";i:0;s:30:"nb_actions_per_visit_returning";i:0;s:21:"bounce_rate_returning";s:2:"0%";s:20:"avg_time_on_site_new";i:0;s:24:"nb_actions_per_visit_new";i:0;s:15:"bounce_rate_new";s:2:"0%";}s:10:"2020-05-23";a:19:{s:35:"Referrers_visitorsFromSearchEngines";i:0;s:36:"Referrers_visitorsFromSocialNetworks";i:0;s:33:"Referrers_visitorsFromDirectEntry";i:0;s:30:"Referrers_visitorsFromWebsites";i:0;s:31:"Referrers_visitorsFromCampaigns";i:0;s:41:"Referrers_visitorsFromDirectEntry_percent";s:2:"0%";s:43:"Referrers_visitorsFromSearchEngines_percent";s:2:"0%";s:39:"Referrers_visitorsFromCampaigns_percent";s:2:"0%";s:44:"Referrers_visitorsFromSocialNetworks_percent";s:2:"0%";s:38:"Referrers_visitorsFromWebsites_percent";s:2:"0%";s:11:"bounce_rate";s:2:"0%";s:20:"nb_actions_per_visit";i:0;s:16:"avg_time_on_site";i:0;s:26:"avg_time_on_site_returning";i:0;s:30:"nb_actions_per_visit_returning";i:0;s:21:"bounce_rate_returning";s:2:"0%";s:20:"avg_time_on_site_new";i:0;s:24:"nb_actions_per_visit_new";i:0;s:15:"bounce_rate_new";s:2:"0%";}s:10:"2020-05-24";a:19:{s:35:"Referrers_visitorsFromSearchEngines";i:0;s:36:"Referrers_visitorsFromSocialNetworks";i:0;s:33:"Referrers_visitorsFromDirectEntry";i:0;s:30:"Referrers_visitorsFromWebsites";i:0;s:31:"Referrers_visitorsFromCampaigns";i:0;s:41:"Referrers_visitorsFromDirectEntry_percent";s:2:"0%";s:43:"Referrers_visitorsFromSearchEngines_percent";s:2:"0%";s:39:"Referrers_visitorsFromCampaigns_percent";s:2:"0%";s:44:"Referrers_visitorsFromSocialNetworks_percent";s:2:"0%";s:38:"Referrers_visitorsFromWebsites_percent";s:2:"0%";s:11:"bounce_rate";s:2:"0%";s:20:"nb_actions_per_visit";i:0;s:16:"avg_time_on_site";i:0;s:26:"avg_time_on_site_returning";i:0;s:30:"nb_actions_per_visit_returning";i:0;s:21:"bounce_rate_returning";s:2:"0%";s:20:"avg_time_on_site_new";i:0;s:24:"nb_actions_per_visit_new";i:0;s:15:"bounce_rate_new";s:2:"0%";}s:10:"2020-05-25";a:19:{s:35:"Referrers_visitorsFromSearchEngines";i:0;s:36:"Referrers_visitorsFromSocialNetworks";i:0;s:33:"Referrers_visitorsFromDirectEntry";i:0;s:30:"Referrers_visitorsFromWebsites";i:0;s:31:"Referrers_visitorsFromCampaigns";i:0;s:41:"Referrers_visitorsFromDirectEntry_percent";s:2:"0%";s:43:"Referrers_visitorsFromSearchEngines_percent";s:2:"0%";s:39:"Referrers_visitorsFromCampaigns_percent";s:2:"0%";s:44:"Referrers_visitorsFromSocialNetworks_percent";s:2:"0%";s:38:"Referrers_visitorsFromWebsites_percent";s:2:"0%";s:11:"bounce_rate";s:2:"0%";s:20:"nb_actions_per_visit";i:0;s:16:"avg_time_on_site";i:0;s:26:"avg_time_on_site_returning";i:0;s:30:"nb_actions_per_visit_returning";i:0;s:21:"bounce_rate_returning";s:2:"0%";s:20:"avg_time_on_site_new";i:0;s:24:"nb_actions_per_visit_new";i:0;s:15:"bounce_rate_new";s:2:"0%";}s:10:"2020-05-26";a:19:{s:35:"Referrers_visitorsFromSearchEngines";i:0;s:36:"Referrers_visitorsFromSocialNetworks";i:0;s:33:"Referrers_visitorsFromDirectEntry";i:0;s:30:"Referrers_visitorsFromWebsites";i:0;s:31:"Referrers_visitorsFromCampaigns";i:0;s:41:"Referrers_visitorsFromDirectEntry_percent";s:2:"0%";s:43:"Referrers_visitorsFromSearchEngines_percent";s:2:"0%";s:39:"Referrers_visitorsFromCampaigns_percent";s:2:"0%";s:44:"Referrers_visitorsFromSocialNetworks_percent";s:2:"0%";s:38:"Referrers_visitorsFromWebsites_percent";s:2:"0%";s:11:"bounce_rate";s:2:"0%";s:20:"nb_actions_per_visit";i:0;s:16:"avg_time_on_site";i:0;s:26:"avg_time_on_site_returning";i:0;s:30:"nb_actions_per_visit_returning";i:0;s:21:"bounce_rate_returning";s:2:"0%";s:20:"avg_time_on_site_new";i:0;s:24:"nb_actions_per_visit_new";i:0;s:15:"bounce_rate_new";s:2:"0%";}s:10:"2020-05-27";a:19:{s:35:"Referrers_visitorsFromSearchEngines";i:0;s:36:"Referrers_visitorsFromSocialNetworks";i:0;s:33:"Referrers_visitorsFromDirectEntry";i:0;s:30:"Referrers_visitorsFromWebsites";i:0;s:31:"Referrers_visitorsFromCampaigns";i:0;s:41:"Referrers_visitorsFromDirectEntry_percent";s:2:"0%";s:43:"Referrers_visitorsFromSearchEngines_percent";s:2:"0%";s:39:"Referrers_visitorsFromCampaigns_percent";s:2:"0%";s:44:"Referrers_visitorsFromSocialNetworks_percent";s:2:"0%";s:38:"Referrers_visitorsFromWebsites_percent";s:2:"0%";s:11:"bounce_rate";s:2:"0%";s:20:"nb_actions_per_visit";i:0;s:16:"avg_time_on_site";i:0;s:26:"avg_time_on_site_returning";i:0;s:30:"nb_actions_per_visit_returning";i:0;s:21:"bounce_rate_returning";s:2:"0%";s:20:"avg_time_on_site_new";i:0;s:24:"nb_actions_per_visit_new";i:0;s:15:"bounce_rate_new";s:2:"0%";}s:10:"2020-05-28";a:19:{s:35:"Referrers_visitorsFromSearchEngines";i:0;s:36:"Referrers_visitorsFromSocialNetworks";i:0;s:33:"Referrers_visitorsFromDirectEntry";i:0;s:30:"Referrers_visitorsFromWebsites";i:0;s:31:"Referrers_visitorsFromCampaigns";i:0;s:41:"Referrers_visitorsFromDirectEntry_percent";s:2:"0%";s:43:"Referrers_visitorsFromSearchEngines_percent";s:2:"0%";s:39:"Referrers_visitorsFromCampaigns_percent";s:2:"0%";s:44:"Referrers_visitorsFromSocialNetworks_percent";s:2:"0%";s:38:"Referrers_visitorsFromWebsites_percent";s:2:"0%";s:11:"bounce_rate";s:2:"0%";s:20:"nb_actions_per_visit";i:0;s:16:"avg_time_on_site";i:0;s:26:"avg_time_on_site_returning";i:0;s:30:"nb_actions_per_visit_returning";i:0;s:21:"bounce_rate_returning";s:2:"0%";s:20:"avg_time_on_site_new";i:0;s:24:"nb_actions_per_visit_new";i:0;s:15:"bounce_rate_new";s:2:"0%";}s:10:"2020-05-29";a:19:

[ERR] ERROR [2020-08-19 22:18:24] 28 1 total errors during this script execution, please investigate and try and fix these errors.
ERROR [2020-08-19 22:18:24] 28 Uncaught exception: /home/vcap/app/htdocs/core/CronArchive.php(606): 1 total errors during this script execution, please investigate and try and fix these errors.
[ERR] 1 total errors during this script execution, please investigate and try and fix these errors.
[ERR] #0 /home/vcap/app/htdocs/core/CronArchive.php(599): Piwik\CronArchive->logFatalError('1 total errors ...')
[ERR] #1 /home/vcap/app/htdocs/core/CronArchive.php(331): Piwik\CronArchive->end()
[ERR] #2 /home/vcap/app/htdocs/core/Access.php(635): Piwik\CronArchive->Piwik{closure}()
[ERR] #3 /home/vcap/app/htdocs/core/CronArchive.php(335): Piwik\Access::doAsSuperUser(Object(Closure))
[ERR] #4 /home/vcap/app/htdocs/plugins/CoreConsole/Commands/CoreArchiver.php(27): Piwik\CronArchive->main()
[ERR] #5 /home/vcap/app/htdocs/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
[ERR] #6 /home/vcap/app/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
[ERR] #7 /home/vcap/app/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\Plugins\CoreConsole\Commands\CoreArchiver), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
[ERR] #8 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
[ERR] #9 /home/vcap/app/htdocs/core/Console.php(140): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
[ERR] #10 /home/vcap/app/htdocs/core/Access.php(644): Piwik\Console->Piwik{closure}()
[ERR] #11 /home/vcap/app/htdocs/core/Console.php(141): Piwik\Access::doAsSuperUser(Object(Closure))
[ERR] #12 /home/vcap/app/htdocs/core/Console.php(93): Piwik\Console->doRunImpl(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
[ERR] #13 /home/vcap/app/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
[ERR] #14 /home/vcap/app/htdocs/console(32): Symfony\Component\Console\Application->run()
[ERR] #15 {main}
[ERR] [Exception]
[ERR] 1 total errors during this script execution, please investigate and try and fix these errors.
[ERR] core:archive [--url="..."] [--force-all-websites] [--force-all-periods[="..."]] [--force-timeout-for-periods[="..."]] [--skip-idsites[="..."]] [--skip-all-segments] [--force-idsites[="..."]] [--skip-segments-today] [--force-periods[="..."]] [--force-date-last-n="..."] [--force-date-range[="..."]] [--force-idsegments="..."] [--concurrent-requests-per-website[="..."]] [--concurrent-archivers[="..."]] [--disable-scheduled-tasks] [--accept-invalid-ssl-certificate] [--php-cli-options[="..."]]

@tsteur commented on August 20th 2020 Member

@reddipravi which version of Matomo are you using? We have recently added some change that might fix or at least change the error message.

note: this code should remove the initially printed message but in above example it seems there were three hashed (###) https://github.com/matomo-org/matomo/blob/3.14.1-b1/core/CliMulti/Output.php#L63

@reddipravi commented on August 20th 2020

@tsteur
Matomo version: 3.13.5
MySQL version: 10.1.35-MariaDB
PHP version: 7.2.20

@tsteur commented on August 20th 2020 Member

@reddipravi thanks for this. Any chance you could create a file named bootstrap.php in your Matomo directory and then add those two lines:

<?php
define('PIWIK_ARCHIVE_NO_TRUNCATE', true);

Next time the archiving runs we should then be able to see the full output as it's currently cut in the middle and there might be some error message at the end. We'd then need the full output of a new archiving run like you posted above (after the archiving ran after you added this file).

Powered by GitHub Issue Mirror