@tsteur opened this Issue on January 12th 2022 Member

PHP 8.0

Uncaught exception: TypeError: key(): Argument #1 ($array) must be of type array, null given in /plugins/ImageGraph/API.php:242
Stack trace:
#0 /plugins/ImageGraph/API.php(242): key(NULL)
#1 [internal function]: Piwik\Plugins\ImageGraph\API->get(1, 'day', '2021-12-12,2022...', 'SearchEngineKey...', 'getCrawlingErro...', 'evolution', '2', false, false, true, 700, 200, 9, 11, true, false, false, '222222', 'FFFFFF', 'CCCCCC', false, true, false, false)
#2 /core/API/Proxy.php(244): call_user_func_array(Array, Array)
#3 /core/Context.php(28): Piwik\API\Proxy->Piwik\API{closure}()
#4 /core/API/Proxy.php(335): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))
#5 /core/API/Request.php(266): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'get', Array)
#6 /core/ReportRenderer.php(270): Piwik\API\Request->process()
#7 /core/ReportRenderer/Html.php(176): Piwik\ReportRenderer::getStaticGraph(Array, 700, 200, false, NULL)
#8 /core/ReportRenderer/Html.php(140): Piwik\ReportRenderer\Html->getAttachment(Array, Array, 'Monday, January...')
#9 /plugins/ScheduledReports/API.php(1021): Piwik\ReportRenderer\Html->getAttachments(Array, Array, 'Monday, January...')
#10 /plugins/ScheduledReports/API.php(551): Piwik\Plugins\ScheduledReports\API->getAttachments(Object(Piwik\ReportRenderer\Html), Array, Array, 'Monday, January...')
#11 /plugins/ScheduledReports/API.php(608): Piwik\Plugins\ScheduledReports\API->generateReport('1', '2022-01-10', 'en', 2, 'day')
#12 /core/Context.php(75): Piwik\Plugins\ScheduledReports\API->Piwik\Plugins\ScheduledReports{closure}()
#13 /plugins/ScheduledReports/API.php(679): Piwik\Context::changeIdSite('1', Object(Closure))
#14 [internal function]: Piwik\Plugins\ScheduledReports\API->sendReport('1')
#15 /core/Scheduler/Scheduler.php(276): call_user_func(Array, '1')
#16 /core/Scheduler/Scheduler.php(148): Piwik\Scheduler\Scheduler->executeTask(Object(Piwik\Scheduler\Task))
#17 /plugins/CoreAdminHome/API.php(69): Piwik\Scheduler\Scheduler->run()
#18 /core/CronArchive.php(627): Piwik\Plugins\CoreAdminHome\API->runScheduledTasks()
#19 /core/CronArchive.php(264): Piwik\CronArchive->runScheduledTasks()
#20 /core/Access.php(661): Piwik\CronArchive->Piwik{closure}()
#21 /core/CronArchive.php(269): Piwik\Access::doAsSuperUser(Object(Closure))
#22 /plugins/CoreConsole/Commands/CoreArchiver.php(32): Piwik\CronArchive->main()
#23 /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))
#24 /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))
#25 /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))
#26 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /core/Console.php(130): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /core/Access.php(670): Piwik\Console->Piwik{closure}()
#29 /core/Console.php(131): Piwik\Access::doAsSuperUser(Object(Closure))
#30 /core/Console.php(82): Piwik\Console->doRunImpl(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /console(32): Symfony\Component\Console\Application->run()
#33 {main}

@tsteur commented on January 12th 2022 Member

Marking this as a regression as it used to work on older PHP versions and now prevents us from sending scheduled reports.

@peterhashair commented on January 12th 2022 Contributor

No luck to reproduce this one, but would that works
/plugins/ImageGraph/API.php(242)

        -    if (empty($columns)
        +   if (empty($columns) && !$metadata['metrics']) 
@sgiehl commented on January 12th 2022 Member

@tsteur this might be an issue with the SearchPerformance plugin. The report GetCrawlingErrorExamplesBing does not define any metrics, as it's no typical report. It can't be displayed as an evolution. So we either could try to prevent that report to be included in scheduled reports at all, or we display an empty graph in that case (which was the case with PHP 7 I guess).

@tsteur commented on January 12th 2022 Member

@sgiehl I'll create an issue for the feature to change this. Does it make sense to at least still keep showing an empty report so things at least won't fail? Or we keep failing so it's more clear if unexpected things happen?
I don't have a clear preference as both have pros and cons. I suppose if core would render an empty graph in that case and not fail, we might still notice there's an issue?

@sgiehl commented on January 13th 2022 Member

I guess we will only notice an error if someone reports it if the graphs are empty.
Maybe we could check if a metric to print is available and if not, log an error and maybe even print an error in the PDF instead. Just a simple text that an error occurred while processing this report.

Powered by GitHub Issue Mirror