@tsteur opened this Issue on August 12th 2021 Member

See below stack trace. Not sure how this would happen. Maybe some PHP bug. It's the latest PHP 7.4. I think I've seen this once before. I will comment when this happens again and put it for now into backlog so we won't work on it.

"Argument 1 passed to Piwik\Category\CategoryList::addCategory() must be an instance of Piwik\Cache, instance of Piwik\Plugins\CoreHome\Categories\ActionsCategory given, called in /core\/Category\/CategoryList.php on line 70","file":"/core\/Category\/CategoryList.php","line":26,"request_id":"3a688","backtrace":" on /core\/Category\/CategoryList.php(26)\n#0 /core\/Category\/CategoryList.php(70): Piwik\Category\CategoryList->addCategory(Object(Piwik\Plugins\CoreHome\Categories\ActionsCategory))\n#1 /plugins\/CustomReports\/Model\/CustomReportsModel.php(200): Piwik\Category\CategoryList::get()\n#2 /plugins\/CustomReports\/Model\/CustomReportsModel.php(221): Piwik\Plugins\CustomReports\Model\CustomReportsModel->getCategoryList()\n#3 /plugins\/CustomReports\/Model\/CustomReportsModel.php(190): Piwik\Plugins\CustomReports\Model\CustomReportsModel->buildCategoryMetadata('General_Actions')\n#4 /plugins\/CustomReports\/Model\/CustomReportsModel.php(170): Piwik\Plugins\CustomReports\Model\CustomReportsModel->enrichReport(Array, false)\n#5 /plugins\/CustomReports\/Model\/CustomReportsModel.php(160): Piwik\Plugins\CustomReports\Model\CustomReportsModel->enrichReports(Array, false)\n#6 /plugins\/CustomReports\/API.php(233): Piwik\Plugins\CustomReports\Model\CustomReportsModel->getAllCustomReportsForSite('1', false)\n#7 [internal function]: Piwik\Plugins\CustomReports\API->getConfiguredReports('1', '0')\n#8 /core\/API\/Proxy.php(244): call_user_func_array(Array, Array)\n#9 /core\/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}()\n#10 /core\/API\/Proxy.php(335): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))\n#11 /core\/API\/Request.php(266): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'getConfiguredRe...', Array)\n#12 /core\/API\/Request.php(559): Piwik\API\Request->process()\n#13 /plugins\/CustomReports\/CustomReports.php(366): Piwik\API\Request::processRequest('CustomReports.g...', Array, Array)\n#14 /plugins\/CustomReports\/CustomReports.php(197): Piwik\Plugins\CustomReports\CustomReports->getConfiguredReports(1)\n#15 [internal function]: Piwik\Plugins\CustomReports\CustomReports->addCustomReports(Array)\n#16 /core\/EventDispatcher.php(141): call_user_func_array(Array, Array)\n#17 /core\/Piwik.php(809):

@sgiehl commented on August 13th 2021 Member

Argument 1 passed to Piwik\Category\CategoryList::addCategory() must be an instance of Piwik\Cache, instance of Piwik\Plugins\CoreHome\Categories\ActionsCategory given, called in /core/Category/CategoryList.php on line 70

That message doesn't make sense at all. The method is defined as:

    public function addCategory(Category $category)

So not sure why it complains about not being an instance of Piwik\Cache 🤷

@tsteur commented on September 22nd 2021 Member

Had now a similar random error with a different class. It must be some PHP bug

Error: {"message":"Argument 3 passed to Piwik\\Segment::__construct() must be an instance of Piwik\\Period\\PeriodValidator or null, instance of Piwik\\Date given, called in /core\/Archive\/ArchiveQueryFactory.php on line 128","file":"/core\/Segment.php","line":124,"request_id":"af6e1","backtrace":" on /core\/Segment.php(124)\n<a href='/0'>#0</a> /core\/Archive\/ArchiveQueryFactory.php(128): Piwik\\Segment->__construct(false, Array, Object(Piwik\\Date), Object(Piwik\\Date))\n<a href='/1'>#1</a> /core\/Archive\/ArchiveQueryFactory.php(32): Piwik\\Archive\\ArchiveQueryFactory->getSegmentFromQueryParam(false, Array, Array)\n<a href='/2'>#2</a> /core\/Archive.php(213): Piwik\\Archive\\ArchiveQueryFactory->build('1', 'day', '2021-09-07,2021...', false, false)\n<a href='/3'>#3</a> /plugins\/Goals\/API.php(531): Piwik\\Archive::build('1', 'day', '2021-09-07,2021...', false)\n<a href='/4'>#4</a> [internal function]: Piwik\\Plugins\\Goals\\API->getMetrics('1', 'day', '2021-09-07,2021...', false, 'ecommerceOrder', 'avg_order_reven...', '1')\n<a href='/5'>#5</a> /core\/API\/Proxy.php(244): call_user_func_array(Array, Array)\n<a href='/6'>#6</a> /core\/Context.php(28): Piwik\\API\\Proxy->Piwik\\API\\{closure}()\n<a href='/7'>#7</a> /core\/API\/Proxy.php(335): Piwik\\Context::executeWithQueryParameters(Array, Object(Closure))\n<a href='/8'>#8</a> /core\/API\/Request.php(266): Piwik\\API\\Proxy->call('\\\\Piwik\\\\Plugins\\\\...', 'getMetrics', Array)\n<a href='/9'>#9</a> /core\/API\/Request.php(559): Piwik\\API\\Request->process()\n<a href='/10'>#10</a> /plugins\/Goals\/API.php(491): Piwik\\API\\Request::processRequest('Goals.getMetric...', Array, Array)\n<a href='/11'>#11</a> [internal function]: Piwik\\Plugins\\Goals\\API->get('1', 'day', '2021-09-07,2021...', false, 'ecommerceOrder', 'avg_order_reven...', '1', false)\n<a href='/12'>#12</a> /core\/API\/Proxy.php(244): call_user_func_array(Array, Array)\n<a href='/13'>#13</a> /core\/Context.php(28): Piwik\\API\\Proxy->Piwik\\API\\{closure}()\n<a href='/14'>#14</a> /core\/API\/Proxy.php(335): Piwik\\Context::executeWithQueryParameters(Array, Object(Closure))\n<a href='/15'>#15</a> /core\/API\/Request.php(266): Piwik\\API\\Proxy->call('\\\\Piwik\\\\Plugins\\\\...', 'get', Array)\n<a href='/16'>#16</a> /core\/ViewDataTable\/Request.php(43): Piwik\\API\\Request->process()\n<a href='/17'>#17</a> /core\/Plugin\/ViewDataTable.php(368): Piwik\\ViewDataTable\\Request->loadDataTableFromAPI(Array)\n<a href='/18'>#18</a>
@tsteur commented on September 27th 2021 Member

And a similar one

Error: {"message":"Call to undefined method Piwik\ProxyHttp::getName()","file":"vendor\/twig\/twig\/src\/ExtensionSet.php","line":397,"requestid":"5f6ef","backtrace":" on vendor\/twig\/twig\/src\/ExtensionSet.php(397)\n#0 vendor\/twig\/twig\/src\/ExtensionSet.php(386): Twig\ExtensionSet->initExtension(Object(Twig\Extension\CoreExtension))\n#1 vendor\/twig\/twig\/src\/ExtensionSet.php(360): Twig\ExtensionSet->initExtensions()\n#2 vendor\/twig\/twig\/src\/Environment.php(794): Twig\ExtensionSet->getUnaryOperators()\n#3 vendor\/twig\/twig\/src\/Lexer.php(457): Twig\Environment->getUnaryOperators()\n#4 vendor\/twig\/twig\/src\/Lexer.php(108): Twig\Lexer->getOperatorRegex()\n#5 vendor\/twig\/twig\/src\/Environment.php(457): Twig\Lexer->construct(Object(Twig\Environment))\n#6 vendor\/twig\/twig\/src\/Environment.php(507): Twig\Environment->tokenize(Object(Twig\Source))\n#7 vendor\/twig\/twig\/src\/Environment.php(348): Twig\Environment->compileSource(Object(Twig\Source))\n#8 vendor\/twig\/twig\/src\/Environment.php(309): Twig\Environment->loadTemplate('TwigTemplate...', '@CustomPlugin\/safemode...')\n#9 vendor\/twig\/twig\/src\/Environment.php(277): Twig\Environment->load('@CustomPlugin\/safemode...')\n#10 core\/View.php(318): Twig\Environment->render('@CustomPlugin\/safemode...', Array)\n#11 core\/View.php(303): Piwik\View->renderTwigTemplate()\n#12 plugins\/CustomPlugin\/Controller.php(316): Piwik\View->render()\n#13 [internal function]: Piwik\Plugins\CustomPlugin\Controller->safemode(Array)\n#14 core\/FrontController.php(616): call_user_func_array(Array, Array)\n#15 core\/FrontController.php(167): Piwik\FrontController->doDispatch('CustomPlugin', 'safemode', Array)\n#16 core\/FrontController.php(98): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#17 core\/FrontController.php(138): Piwik\FrontController::generateSafeModeOutputFromError(Array)\n#18 core\/FrontController.php(188): Piwik\FrontController::generateSafeModeOutputFromException(Object(Error))\n#19 core\/FrontController.php(98): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#20 core\/FrontController.php(138): Piwik\FrontController::generateSafeModeOutputFromError(Array)\n#21 core\/FrontController.php(188): Piwik\FrontController::generateSafeModeOutputFromException(Object(Error))\n#22 core\/Plugin\/Controller.php(975): Piwik\FrontController->dispatch('Login', false)\n#23 plugins\/CoreHome\/Controller.php(138): Piwik\Plugin\Controller->redirectToIndex('CoreHome', 'index', 0)\n#24 [internal function]: Piwik\Plugins\CoreHome\Controller->redirectToCoreHomeIndex()\n#25 core\/FrontController.php(616): call_user_func_array(Array, Array)\n#26 core\/FrontController.php(167): Piwik\FrontController->doDispatch('CoreHome', false, Array)\n#27 core\/dispatch.php(32): Piwik\FrontController->dispatch()\n#28 index.php(25): require_once('c...')\n#29 {main}","safemode_backtrace":"#0 [internal function]: Piwik\Plugins\CustomPlugin\Controller->safemode(Array)\n#1 \/core\/FrontController.php(616): call_user_func_array(Array, Array)\n#2 \/core\/FrontController.php(167): Piwik\FrontController->doDispatch('CustomPlugin', 'safemode', Array)\n#3 \/core\/FrontController.php(98): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#4 \/core\/FrontController.php(138): Piwik\FrontController::(Array)\n#5 \/core\/FrontController.php(188): Piwik\FrontController::(Object(Error))\n#6 \/core\/FrontController.php(98): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#7 \/core\/FrontController.php(138): Piwik\FrontController::(Array)\n#8 \/core\/FrontController.php(188): Piwik\FrontController::(Object(Error))\n#9 \/core\/FrontController.php(98): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#10 \/core\/FrontController.php(138): Piwik\FrontController::(Array)\n#11 \/core\/FrontController.php(188): Piwik\FrontController::(Object(Error))\n#12 \/core\/Plugin\/Controller.php(975): Piwik\FrontController->dispatch('Login', false)\n#13 \/plugins\/CoreHome\/Controller.php(138): Piwik\Plugin\Controller->redirectToIndex('CoreHome', 'index', 0)\n#14 [internal function]: Piwik\Plugins\CoreHome\Controller->redirectToCoreHomeIndex()\n#15 \/core\/FrontController.php(616): call_user_func_array(Array, Array)\n#16 \/core\/FrontController.php(167): Piwik\FrontController->doDispatch('CoreHome', false, Array)\n#17 \/core\/dispatch.php(32): Piwik\FrontController->dispatch()\n#18 \/index.php(25): require_once('\/c...')\n#19 {main}

image

it's trying to call ProxyHttp there

Powered by GitHub Issue Mirror