@tsteur opened this Issue on December 19th 2018 Member

Here's a stacktrace

Error: {"message":"Argument 1 passed to Piwik\Report\ReportWidgetFactory::construct() must be an instance of Piwik\Plugin\Report, null given, called in \/plugins\/Goals\/Pages.php on line 345","file":"\/core\/Report\/ReportWidgetFactory.php","line":33,"backtrace":" on \/core\/Report\/ReportWidgetFactory.php(33)\n#0 \/plugins\/Goals\/Pages.php(345): Piwik\Report\ReportWidgetFactory->construct(NULL)\n#1 \/plugins\/Goals\/Pages.php(297): Piwik\Plugins\Goals\Pages->createWidgetForReport('CustomDimension...', 'getCustomDimens...')\n#2 \/plugins\/Goals\/Pages.php(83): Piwik\Plugins\Goals\Pages->buildGoalByDimensionView('', Object(Piwik\Widget\WidgetContainerConfig))\n#3 \/plugins\/Goals\/Reports\/Get.php(75): Piwik\Plugins\Goals\Pages->createGoalsOverviewPage(Array)\n#4 \/core\/Widget\/WidgetsList.php(199): Piwik\Plugins\Goals\Reports\Get->configureWidgets(Object(Piwik\Widget\WidgetsList), Object(Piwik\Report\ReportWidgetFactory))\n#5 \/plugins\/API\/API.php(370): Piwik\Widget\WidgetsList::get()\n#6 [internal function]: Piwik\Plugins\API\API->getWidgetMetadata('2')\n#7 \/core\/API\/Proxy.php(232): call_user_func_array(Array, Array)\n#8 \/core\/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}()\n#9 \/core\/API\/Proxy.php(323): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))\n#10 \/core\/API\/Request.php(263): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'getWidgetMetada...', Array)\n#11 \/plugins\/API\/Controller.php(41): Piwik\API\Request->process()\n#12 [internal function]: Piwik\Plugins\API\Controller->index()\n#13 \/core\/FrontController.php(556): call_user_func_array(Array, Array)\n#14 \/core\/FrontController.php(144): Piwik\FrontController->doDispatch('API', false, Array)\n#15 \/core\/dispatch.php(34): Piwik\FrontController->dispatch()\n#16 \/index.php(27): require_once('...')\n#17 {main}"}

URL: ?module=API&method=API.getWidgetMetadata&filter_limit=-1&format=JSON&deep=1&idSite=2


Happens here: https://github.com/matomo-org/matomo/blob/3.8.0-b5/plugins/Goals/Pages.php#L344-L345

I was going to create a PR that checks whether $report was found and if not, return null and just skip this report/widget but not sure if this would maybe just suppress the error while there is a problem with an actual implementation. Cause in theory it iterates over all found reports and it should find a report class. For custom dimensions (which is the problem see stack trace) there were a few changes around the reports and widgets recently so maybe something regressed there?

I can check for the dashboard configuration if needed. Moving it into 3.8 as the dashboard cannot be loaded in this case by the looks

@tsteur commented on December 19th 2018 Member

Just checked there seems to be no dashboard configured.

One custom dimension is defined

INSERT INTO `custom_dimensions` (`idcustomdimension`, `idsite`, `name`, `index`, `scope`, `active`, `extractions`, `case_sensitive`)
    (1, 2, 'ID Foo', 1, 'visit', 1, '[]', 1);
@tsteur commented on December 19th 2018 Member

Closing the issue for now. I've tried to debug locally and reproduce the issue locally as well as on the actual instance but couldn't reproduce it. If it occurs again need to check. Seems some race condition maybe or so.

@tsteur commented on December 20th 2018 Member

Same issue happened again. Seems to happen very rarely. Possibly a race condition and maybe it is actually easiest to just check whether report was returned and if not, don't add the widget as it seems to happen very very rarely.

This Issue was closed on December 21st 2018
Powered by GitHub Issue Mirror