Archiving error when calculating "Year" data

I noted a previous problem when archiving “Year” data for a single site. I noticed that I get exactly the same error for any of three sites I track. I checked the database and can’t find any issues with the numeric archive data for 2023 (sited in the error). Below is the output of a typical run.

INFO [2023-11-15 19:40:39] 323861 Skipped Archiving website id 1, period = year, date = 2023-01-01, segment = ‘’, 0 visits found. Time elapsed: 0.855s
INFO [2023-11-15 19:40:39] 323861 Finished archiving for site 1, 4 API requests, Time elapsed: 4.609s [1 / 3 done]

INFO [2023-11-15 19:40:39] 323861 Start processing archives for site 2.

Then, I get this error message at the end of the run:

INFO [2023-11-15 19:40:39] 323861 SUMMARY OF ERRORS
INFO [2023-11-15 19:40:39] 323861 Error: Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=year&date=2023-01-01&format=json&trigger=archivephp. Response was ‘{“result”:“error”,“message”:“The unserialization has failed! - in plugin Actions. #0 /srv/matomo/core/ArchiveProcessor/Loader.php(289): Piwik\ArchiveProcessor\PluginsArchiver->callAggregateAllPlugins() #1 /srv/matomo/core/ArchiveProcessor/Loader.php(181): Piwik\ArchiveProcessor\Loader->prepareAllPluginsArchive() #2 /srv/matomo/core/ArchiveProcessor/Loader.php(164): Piwik\ArchiveProcessor\Loader->insertArchiveData() #3 /srv/matomo/core/ArchiveProcessor/Loader.php(104): Piwik\ArchiveProcessor\Loader->prepareArchiveImpl() #4 /srv/matomo/core/Context.php(75): Piwik\ArchiveProcessor\Loader->Piwik\ArchiveProcessor{closure}() #5 /srv/matomo/core/ArchiveProcessor/Loader.php(108): Piwik\Context::changeIdSite() #6 /srv/matomo/plugins/CoreAdminHome/API.php(294): Piwik\ArchiveProcessor\Loader->prepareArchive() #7 [internal function]: Piwik\Plugins\CoreAdminHome\API->archiveReports() #8 /srv/matomo/core/API/Proxy.php(244): call_user_func_array() #9 /srv/matomo/core/Context.php(28): Piwik\API\Proxy->Piwik\API{closure}() #10 /srv/matomo/core/API/Proxy.php(335): Piwik\Context::executeWithQueryParameters() #11 /srv/matomo/core/API/Request.php(267): Piwik\API\Proxy->call() #12 /srv/matomo/plugins/API/Controller.php(45): Piwik\API\Request->process() #13 [internal function]: Piwik\Plugins\API\Controller->index() #14 /srv/matomo/core/FrontController.php(637): call_user_func_array() #15 /srv/matomo/core/FrontController.php(169): Piwik\FrontController->doDispatch() #16 /srv/matomo/core/dispatch.php(32): Piwik\FrontController->dispatch() #17 /srv/matomo/index.php(25): require_once(’/srv/matomo/cor…‘) #18 /srv/matomo/core/CliMulti/RequestCommand.php(79): require_once(’/srv/matomo/ind…‘) #19 /srv/matomo/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\CliMulti\RequestCommand->execute() #20 /srv/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run() #21 /srv/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand() #22 /srv/matomo/core/Console.php(108): Symfony\Component\Console\Application->doRun() #23 [internal function]: Piwik\Console->originDoRun() #24 /srv/matomo/core/Console.php(147): call_user_func() #25 /srv/matomo/core/Access.php(670): Piwik\Console->Piwik{closure}() #26 /srv/matomo/core/Console.php(148): Piwik\Access::doAsSuperUser() #27 /srv/matomo/core/Console.php(87): Piwik\Console->doRunImpl() #28 /srv/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun() #29 /srv/matomo/console(32): Symfony\Component\Console\Application->run() #30 {main}, caused by: The unserialization has failed! #0 /srv/matomo/core/DataTable.php(1461): Piwik\DataTable->unserializeRows() #1 /srv/matomo/core/DataTable.php(1936): Piwik\DataTable->addRowsFromSerializedArray() #2 /srv/matomo/core/ArchiveProcessor.php(400): Piwik\DataTable::fromSerializedArray() #3 /srv/matomo/core/ArchiveProcessor.php(375): Piwik\ArchiveProcessor->getAggregatedDataTableMapFromBlobs() #4 /srv/matomo/core/ArchiveProcessor.php(232): Piwik\ArchiveProcessor->aggregateDataTableRecord() #5 /srv/matomo/plugins/Actions/Archiver.php(649): Piwik\ArchiveProcessor->aggregateDataTableRecords() #6 /srv/matomo/core/Plugin/Archiver.php(108): Piwik\Plugins\Actions\Archiver->aggregateMultipleReports() #7 /srv/matomo/core/ArchiveProcessor/PluginsArchiver.php(173): Piwik\Plugin\Archiver->callAggregateMultipleReports() #8 /srv/matomo/core/ArchiveProcessor/Loader.php(289): Piwik\ArchiveProcessor\PluginsArchiver->callAggregateAllPlugins() #9 /srv/matomo/core/ArchiveProcessor/Loader.php(181): Piwik\ArchiveProcessor\Loader->prepareAllPluginsArchive() #10 /srv/matomo/core/ArchiveProcessor/Loader.php(164): Piwik\ArchiveProcessor\Loader->insertArchiveData() #11 /srv/matomo/core/ArchiveProcessor/Loader.php(104): Piwik\ArchiveProcessor\Loader->prepareArchiveImpl() #12 /srv/matomo/core/Context.php(75): Piwik\ArchiveProcessor\Loader->Piwik\ArchiveProcessor{closure}() #13 /srv/matomo/core/ArchiveProcessor/Loader.php(108): Piwik\Context::changeIdSite() #14 /srv/matomo/plugins/CoreAdminHome/API.php(294): Piwik\ArchiveProcessor\Loader->prepareArchive() #15 [internal function]: Piwik\Plugins\CoreAdminHome\API->archiveReports() #16 /srv/matomo/core/API/Proxy.php(244): call_user_func_array() #17 /srv/matomo/core/Context.php(28): Piwik\API\Proxy->Piwik\API{closure}() #18 /srv/matomo/core/API/Proxy.php(335): Piwik\Context::executeWithQueryParameters() #19 /srv/matomo/core/API/Request.php(267): Piwik\API\Proxy->call() #20 /srv/matomo/plugins/API/Controller.php(45): Piwik\API\Request->process() #21 [internal function]: Piwik\Plugins\API\Controller->index() #22 /srv/matomo/core/FrontController.php(637): call_user_func_array() #23 /srv/matomo/core/FrontController.php(169): Piwik\FrontController->doDispatch() #24 /srv/matomo/core/dispatch.php(32): Piwik\FrontController->dispatch() #25 /srv/matomo/index.php(25): require_once(’/srv/matomo/cor…‘) #26 /srv/matomo/core/CliMulti/RequestCommand.php(79): require_once(’/srv/matomo/ind…‘) #27 /srv/matomo/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(25 … un()\n#37 /srv/matomo/console(32): Symfony\Component\Console\Application->run()\n#38 {main}”}’
ERROR [2023-11-15 19:40:39] 323861 1 total errors during this script execution, please investigate and try and fix these errors.
ERROR [2023-11-15 19:40:39] 323861 Uncaught exception: /srv/matomo/core/CronArchive.php(631): 1 total errors during this script execution, please investigate and try and fix these errors. [Query: , CLI mode: 1]

[Exception]
1 total errors during this script execution, please investigate and try and fix these errors.

core:archive [–url=“…”] [–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[=“…”]] [–max-websites-to-process=“…”] [–max-archives-to-process=“…”] [–disable-scheduled-tasks] [–accept-invalid-ssl-certificate] [–php-cli-options[=“…”]] [–force-all-websites] [–force-report[=“…”]]

Hi @bobwalter
Did you also update Matomo version? Which version do you run?

I am running 4.15.1. My system check says I have the current version and there are no errors.

Hi @bobwalter
Is this log the one of the CRON of of Matomo web?
If not from Matomo web, can you check if there is an error in Matomo web error log file?