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

Error in plugin with cron: console core:archive #87

Closed
G4Zz0L1 opened this issue Jan 17, 2022 · 5 comments
Closed

Error in plugin with cron: console core:archive #87

G4Zz0L1 opened this issue Jan 17, 2022 · 5 comments

Comments

@G4Zz0L1
Copy link

G4Zz0L1 commented Jan 17, 2022

I've got this for quite some time now, I've waited to see if someone else got the same error.
As the title, I've got this when my cron runs console core:archive and this error shows up.
It started like 2-3 weeks ago.
If you need something else, let me know.

ERROR [2022-01-16 23:00:01] 1022806  Uncaught exception: TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "Piwik\Plugins\BotTracker\getActiveIcon" not found or invalid function name in /usr/share/webapps/matomo/core/DataTable/Filter/ColumnCallbackAddMetadata.php:82
Stack trace:
#0 /usr/share/webapps/matomo/core/DataTable/Filter/ColumnCallbackAddMetadata.php(82): call_user_func_array()
#1 /usr/share/webapps/matomo/core/DataTable.php(533): Piwik\DataTable\Filter\ColumnCallbackAddMetadata->filter()
#2 /usr/share/webapps/matomo/plugins/BotTracker/API.php(68): Piwik\DataTable->filter()
#3 /usr/share/webapps/matomo/plugins/BotTracker/API.php(232): Piwik\Plugins\BotTracker\API->getAllBotDataWithIcon()
#4 [internal function]: Piwik\Plugins\BotTracker\API->getBotTracker()
#5 /usr/share/webapps/matomo/core/API/Proxy.php(244): call_user_func_array()
#6 /usr/share/webapps/matomo/core/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}()
#7 /usr/share/webapps/matomo/core/API/Proxy.php(335): Piwik\Context::executeWithQueryParameters()
#8 /usr/share/webapps/matomo/core/API/Request.php(266): Piwik\API\Proxy->call()
#9 /usr/share/webapps/matomo/plugins/API/ProcessedReport.php(378): Piwik\API\Request->process()
#10 /usr/share/webapps/matomo/plugins/API/API.php(287): Piwik\Plugins\API\ProcessedReport->getProcessedReport()
#11 [internal function]: Piwik\Plugins\API\API->getProcessedReport()
#12 /usr/share/webapps/matomo/core/API/Proxy.php(244): call_user_func_array()
#13 /usr/share/webapps/matomo/core/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}()
#14 /usr/share/webapps/matomo/core/API/Proxy.php(335): Piwik\Context::executeWithQueryParameters()
#15 /usr/share/webapps/matomo/core/API/Request.php(266): Piwik\API\Proxy->call()
#16 /usr/share/webapps/matomo/core/API/Request.php(559): Piwik\API\Request->process()
#17 /usr/share/webapps/matomo/plugins/ScheduledReports/API.php(441): Piwik\API\Request::processRequest()
#18 /usr/share/webapps/matomo/plugins/ScheduledReports/API.php(608): Piwik\Plugins\ScheduledReports\API->generateReport()
#19 /usr/share/webapps/matomo/core/Context.php(75): Piwik\Plugins\ScheduledReports\API->Piwik\Plugins\ScheduledReports\{closure}()
#20 /usr/share/webapps/matomo/plugins/ScheduledReports/API.php(679): Piwik\Context::changeIdSite()
#21 [internal function]: Piwik\Plugins\ScheduledReports\API->sendReport()
#22 /usr/share/webapps/matomo/core/Scheduler/Scheduler.php(276): call_user_func()
#23 /usr/share/webapps/matomo/core/Scheduler/Scheduler.php(148): Piwik\Scheduler\Scheduler->executeTask()
#24 /usr/share/webapps/matomo/plugins/CoreAdminHome/API.php(69): Piwik\Scheduler\Scheduler->run()
#25 /usr/share/webapps/matomo/core/CronArchive.php(627): Piwik\Plugins\CoreAdminHome\API->runScheduledTasks()
#26 /usr/share/webapps/matomo/core/CronArchive.php(264): Piwik\CronArchive->runScheduledTasks()
#27 /usr/share/webapps/matomo/core/Access.php(661): Piwik\CronArchive->Piwik\{closure}()
#28 /usr/share/webapps/matomo/core/CronArchive.php(269): Piwik\Access::doAsSuperUser()
#29 /usr/share/webapps/matomo/plugins/CoreConsole/Commands/CoreArchiver.php(32): Piwik\CronArchive->main()
#30 /usr/share/webapps/matomo/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute()
#31 /usr/share/webapps/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run()
#32 /usr/share/webapps/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand()
#33 [internal function]: Symfony\Component\Console\Application->doRun()
#34 /usr/share/webapps/matomo/core/Console.php(130): call_user_func()
#35 /usr/share/webapps/matomo/core/Access.php(670): Piwik\Console->Piwik\{closure}()
#36 /usr/share/webapps/matomo/core/Console.php(131): Piwik\Access::doAsSuperUser()
#37 /usr/share/webapps/matomo/core/Console.php(82): Piwik\Console->doRunImpl()
#38 /usr/share/webapps/matomo/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun()
#39 /usr/share/webapps/matomo/console(32): Symfony\Component\Console\Application->run()
#40 {main}

@Thomas--F
Copy link
Owner

That looks strange. The called function "getBotTracker()" is used to create the dashboard-report. I have no clue, why this is called during the archive-run.

But it faults to execute the fuction "getActiveIcon". It's in the file "BotTracker/functions.php"
The import of this file in the API.php (and the BotTracker.php )was deleted by @tsteur in a pull request #83
He explained, the functions.php is already loaded everytime the plugin is loaded. Meybe he wasn't right in the case of the archive-run.
Maybe he can suggest a solution.

@tsteur
Copy link
Contributor

tsteur commented Jan 26, 2022

@Thomas--F above I can see it's a scheduled report that is being generated. Maybe the plugin's postLoad method is not called during archiving (although I would assume it is). In that case you could add in the API something like

public function __construct(){
		$dir = \Piwik\Plugin\Manager::getPluginDirectory('BotTracker');
		require_once $dir . '/functions.php';
}

Thomas--F added a commit that referenced this issue Jan 27, 2022
@Thomas--F
Copy link
Owner

I've tested the construct-function on my local server. It makes no difference, so everything in the dashboard runs as expectet.
But I haven't done the archive-call.
Can you try the version from the "4.x-dev" branch on your system and give a feedback if the archive-call runs now without error?

@G4Zz0L1
Copy link
Author

G4Zz0L1 commented Jan 30, 2022

Sorry for the late reply.
I've tested the 4.x-dev branch on my matomo install, it seems to work fine with the core:archive.

Thomas--F added a commit that referenced this issue Jan 30, 2022
@Thomas--F
Copy link
Owner

Thanks for testing.
The new release is out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants