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

Fatal error: Scheduler: Error The period '/wp-conten' is not supported. #21040

Closed
tsteur opened this issue Jul 20, 2023 · 1 comment · Fixed by #21043
Closed

Fatal error: Scheduler: Error The period '/wp-conten' is not supported. #21040

tsteur opened this issue Jul 20, 2023 · 1 comment · Fixed by #21043
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Jul 20, 2023

See below stack trace.

In the report table the period_param column has the value '/wp-conten' which maybe wasn't validated when the report was created.

As a result, the scheduled tasks fail whenever it tries/retries to send the report.

ERROR [2023-07-17 00:32:03] 24056 Uncaught exception in API: Exception: Date is expecting a unix timestamp, got: ''. in /core/Date.php:105
Stack trace:
#0 /core/Date.php(1103): Piwik\Date->__construct(false, 'UTC')
#1 /core/Period/Range.php(255): Piwik\Date->addPeriod(-29, '/wp-conten')
#2 /core/Period.php(131): Piwik\Period\Range->generate()
#3 /core/Period/Range.php(152): Piwik\Period->getDateStart()
#4 /core/Period/Range.php(543): Piwik\Period\Range->getDateStart()
#5 /plugins/ImageGraph/ImageGraph.php(91): Piwik\Period\Range::getRelativeToEndDate('/wp-conten', 'last30', Object(Piwik\Date), Object(Piwik\Site))
#6 [internal function]: Piwik\Plugins\ImageGraph\ImageGraph->getReportMetadata(Array, Array)
#7 /core/EventDispatcher.php(147): call_user_func_array(Array, Array)
#8 /core/Piwik.php(871): Piwik\EventDispatcher->postEvent('API.getReportMe...', Array, false, Array)
#9 /plugins/API/ProcessedReport.php(220): Piwik\Piwik::postEvent('API.getReportMe...', Array)
#10 /plugins/API/ProcessedReport.php(50): Piwik\Plugins\API\ProcessedReport->getReportMetadata('2', '/wp-conten', '2023-07-10', false, true)
#11 /plugins/API/ProcessedReport.php(349): Piwik\Plugins\API\ProcessedReport->getMetadata('2', 'MultiSites', 'getAll', Array, 'en', '/wp-conten', '2023-07-10', false, true)
#12 /plugins/API/API.php(283): Piwik\Plugins\API\ProcessedReport->getProcessedReport('2', '/wp-conten', '2023-07-10', 'MultiSites', 'getAll', false, Array, false, 'en', true, false, false, false, 'bc', false)
#13 [internal function]: Piwik\Plugins\API\API->getProcessedReport('2', '/wp-conten', '2023-07-10', 'MultiSites', 'getAll', false, Array, false, 'en', true, false, false, false, 'bc', false)
#14 /core/API/Proxy.php(244): call_user_func_array(Array, Array)
#15 /core/Context.php(28): Piwik\API\Proxy->Piwik\API{closure}()
#16 /core/API/Proxy.php(335): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))
#17 /core/API/Request.php(267): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'getProcessedRep...', Array)
#18 /core/API/Request.php(560): Piwik\API\Request->process()
#19 /plugins/ScheduledReports/API.php(480): Piwik\API\Request::processRequest('API.getProcesse...', Array)
#20 /plugins/ScheduledReports/API.php(644): Piwik\Plugins\ScheduledReports\API->generateReport('2', '2023-07-10', 'en', 2, '/wp-conten')
#21 /core/Context.php(75): Piwik\Plugins\ScheduledReports\API->Piwik\Plugins\ScheduledReports{closure}()
#22 /plugins/ScheduledReports/API.php(719): Piwik\Context::changeIdSite('2', Object(Closure))
#23 [internal function]: Piwik\Plugins\ScheduledReports\API->sendReport('2')
#24 /core/Scheduler/Scheduler.php(309): call_user_func(Array, '2')
#25 /core/Scheduler/Scheduler.php(154): Piwik\Scheduler\Scheduler->executeTask(Object(Piwik\Scheduler\Task))
#26 /plugins/CoreAdminHome/API.php(75): Piwik\Scheduler\Scheduler->run()
#27 /core/CronArchive.php(659): Piwik\Plugins\CoreAdminHome\API->runScheduledTasks()
#28 /core/CronArchive.php(277): Piwik\CronArchive->runScheduledTasks()
#29 /core/Access.php(661): Piwik\CronArchive->Piwik{closure}()
...
#43 {main}
ERROR [2023-07-17 00:32:04] 24056 Scheduler: Error The period '/wp-conten' is not supported. Try any of the following instead: day, week, month, year, range for task 'Piwik\Plugins\ScheduledReports\API.sendReport_2'

@tsteur tsteur 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 Jul 20, 2023
@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. and removed 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 Jul 20, 2023
@sgiehl sgiehl added this to the 5.0.0 milestone Jul 20, 2023
@sgiehl
Copy link
Member

sgiehl commented Jul 20, 2023

That parameter indeed isn't validated. Even though it's not possible to send something invalid using the UI, it's possible to directly add garbage through the API. I'll prepare a PR to fix that.

@sgiehl sgiehl self-assigned this Jul 20, 2023
@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants