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

[Bug] Serialization error while archiving #22821

Open
4 tasks done
rolf-siepmann opened this issue Dec 4, 2024 · 2 comments
Open
4 tasks done

[Bug] Serialization error while archiving #22821

rolf-siepmann opened this issue Dec 4, 2024 · 2 comments
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.

Comments

@rolf-siepmann
Copy link

What happened?

Please check: https://forum.matomo.org/t/serialization-error-while-archiving/61411, especially:

The problem is solved when
a) in core/DataTable.php, function unserializeRows.php, add right before ‘return $rows’: if(!is_array($rows)) { $rows = array(); }
b) in core/DataAccess/ArchiveSelector.php, function querySingleBlob, change line 646 to: if(is_array($blobs)) { ksort($blobs); }

There seems to be empty data rows which at least has to be an empty array.

If this is true, how does it happen, what is the best was to clean the data?

What should happen?

archivephp cron job should not break for specific tracked webpages

How can this be reproduced?

e.g.: /usr/bin/php /var/www/piwik/console climulti:request --matomo-domain=“https://xxx/” --superuser “module=API&method=CoreAdminHome.archiveReports&idSite=58&period=year&date=2024-01-01&format=json&trigger=archivephp”

Matomo version

5.1.2

PHP version

8.3.14

Server operating system

Ubuntu 22.04.5 LTS

What browsers are you seeing the problem on?

No response

Computer operating system

No response

Relevant log output

INFO [2024-11-22 07:30:39] 1236 Error: Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=59&period=year&date=2024-01-01&format=json&trigger=archivephp. Response was ‘{“result”:“error”,“message”:"The unserialization has failed! - in plugin Actions. #0 /var/www/dbuser/core/ArchiveProcessor/Loader.php(317): Piwik\ArchiveProcessor\PluginsArchiver->callAggregateAllPlugins() #1 /var/www/dbuser/core/ArchiveProcessor/Loader.php(186): Piwik\ArchiveProcessor\Loader->prepareAllPluginsArchive() #2 /var/www/dbuser/core/ArchiveProcessor/Loader.php(165): Piwik\ArchiveProcessor\Loader->insertArchiveData() #3 /var/www/dbuser/core/ArchiveProcessor/Loader.php(105): Piwik\ArchiveProcessor\Loader->prepareArchiveImpl() #4 /var/www/dbuser/core/Context.php(76): Piwik\ArchiveProcessor\Loader->Piwik\ArchiveProcessor\{closure}() #5 /var/www/dbuser/core/ArchiveProcessor/Loader.php(102): Piwik\Context::changeIdSite() #6 /var/www/dbuser/plugins/CoreAdminHome/API.php(306): Piwik\ArchiveProcessor\Loader->prepareArchive() #7 [internal function]: Piwik\Plugins\CoreAdminHome\API->archiveReports() #8 /var/www/dbuser/core/API/Proxy.php(255): call_user_func_array() #9 /var/www/dbuser/core/Context.php(29): Piwik\API\Proxy->Piwik\API\{closure}() #10 /var/www/dbuser/core/API/Proxy.php(158): Piwik\Context::executeWithQueryParameters() #11 /var/www/dbuser/core/API/Request.php(274): Piwik\API\Proxy->call() #12 /var/www/dbuser/plugins/API/Controller.php(46): Piwik\API\Request->process() #13 [internal function]: Piwik\Plugins\API\Controller->index() #14 /var/www/dbuser/core/FrontController.php(645): call_user_func_array() #15 /var/www/dbuser/core/FrontController.php(169): Piwik\FrontController->doDispatch() #16 /var/www/dbuser/core/dispatch.php(33): Piwik\FrontController->dispatch() #17 /var/www/dbuser/index.php(25): require_once(’…‘) #18 /var/www/dbuser/core/CliMulti/RequestCommand.php(76): require_once(’…‘) #19 /var/www/dbuser/core/Plugin/ConsoleCommand.php(109): Piwik\CliMulti\RequestCommand->doExecute() #20 /var/www/dbuser/vendor/symfony/console/Command/Command.php(298): Piwik\Plugin\ConsoleCommand->execute() #21 /var/www/dbuser/core/Plugin/ConsoleCommand.php(124): Symfony\Component\Console\Command\Command->run() #22 /var/www/dbuser/vendor/symfony/console/Application.php(1040): Piwik\Plugin\ConsoleCommand->run() #23 /var/www/dbuser/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand() #24 /var/www/dbuser/core/Console.php(113): Symfony\Component\Console\Application->doRun() #25 [internal function]: Piwik\Console->originDoRun() #26 /var/www/dbuser/core/Console.php(152): call_user_func() #27 /var/www/dbuser/core/Access.php(672): Piwik\Console->Piwik\{closure}() #28 /var/www/dbuser/core/Console.php(150): Piwik\Access::doAsSuperUser() #29 /var/www/dbuser/core/Console.php(92): Piwik\Console->doRunImpl() #30 /var/www/dbuser/vendor/symfony/console/Application.php(171): Piwik\Console->doRun() #31 /var/www/dbuser/console(32): Symfony\Component\Console\Application->run() #32 {main}, caused by: The unserialization has failed! #0 /var/www/dbuser/core/DataTable.php(1494): Piwik\DataTable->unserializeRows() #1 /var/www/dbuser/core/DataTable.php(1987): Piwik\DataTable->addRowsFromSerializedArray() #2 /var/www/dbuser/core/ArchiveProcessor.php(403): Piwik\DataTable::fromSerializedArray() #3 /var/www/dbuser/core/ArchiveProcessor.php(378): Piwik\ArchiveProcessor->getAggregatedDataTableMapFromBlobs() #4 /var/www/dbuser/core/ArchiveProcessor.php(234): Piwik\ArchiveProcessor->aggregateDataTableRecord() #5 /var/www/dbuser/core/ArchiveProcessor/RecordBuilder.php(205): Piwik\ArchiveProcessor->aggregateDataTableRecords() #6 /var/www/dbuser/core/Plugin/Archiver.php(247): Piwik\ArchiveProcessor\RecordBuilder->buildForNonDayPeriod() #7 /var/www/dbuser/core/ArchiveProcessor/PluginsArchiver.php(190): Piwik\Plugin\Archiver->callAggregateMultipleReports() #8 /var/www/dbuser/core/ArchiveProcessor/Loader.php(317): Piwik\ArchiveProcessor\PluginsArchiver->callAggregateAllPlugins() #9 /var/www/dbuser/core/ArchiveProcessor/Loader.php(186): Piwik\ArchiveProcessor\Loader->prepareAllPluginsArchive() #10 /var/www/dbuser/core/ArchiveProcessor/Loader.php(165): Piwik\ArchiveProcessor\Loader->insertArchiveData() #11 /var/www/dbuser/core/ArchiveProcessor/Loader.php(105): Piwik\ArchiveProcessor\Loader->prepareArchiveImpl() #12 /var/www/dbuser/core/Context.php(76): Piwik\ArchiveProcessor\Loader->Piwik\ArchiveProcessor\{closure}() #13 /var/www/dbuser/core/ArchiveProcessor/Loader.php(102): Piwik\Context::changeIdSite() #14 /var/www/dbuser/plugins/CoreAdminHome/API.php(306): Piwik\ArchiveProcessor\Loader->prepareArchive() #15 [internal function]: Piwik\Plugins\CoreAdminHome\API->archiveReports() #16 /var/www/dbuser/core/API/Proxy.php(255): call_user_func_array() #17 /var/www/dbuser/core/Context.php(29): Piwik\API\Proxy->Piwik\API\{closure}() #18 /var/www/dbuser/core/API/Proxy.php(158): Piwik\Context::executeWithQueryParameters() #19 /var/www/dbuser/core/API/Request.php(274): Piwik\API\Proxy->call() #20 /var/www/dbuser/plugins/API/Controller.php(46): Piwik\API\Request->process() #21 [internal function]: Piwik\Plugins\API\Controller->index() #22 /var/www/dbuser/core/FrontController.php(645): call_user_func_array() #23 /var/www/dbuser/core/FrontController.php(169): Piwik\FrontController->doDispatch() #24 /var/www/dbuser/core … n#39 /var/www/dbuser/console(32): Symfony\Component\Console\Application->run()\n#40 {main}"}’

Validations

@rolf-siepmann rolf-siepmann added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Dec 4, 2024
@MatomoForumNotifications

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/serialization-error-while-archiving/61411/8

@randy-innocraft randy-innocraft removed the To Triage An issue awaiting triage by a Matomo core team member label Dec 4, 2024
@rolf-siepmann
Copy link
Author

update to Matomo version 5.2.0, including update to php version 8.4.1, doesn't solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.
Projects
None yet
Development

No branches or pull requests

3 participants