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

Fix for current year not processed for new custom repors #18343

Closed
Starker3 opened this issue Nov 18, 2021 · 0 comments · Fixed by #19569
Closed

Fix for current year not processed for new custom repors #18343

Starker3 opened this issue Nov 18, 2021 · 0 comments · Fixed by #19569
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.

Comments

@Starker3
Copy link
Contributor

Expected Behavior

We would expect that regardless of the number of months set using rearchive_reports_in_past_last_n_months that the reports for the current year will always be processed for the given plugin.

Current Behavior

When setting a longer period of time for rearchive_reports_in_past_last_n_months such as for example 48 months, the current year reports for that plugin may not be processed. (This seems to work fine for something like 12 months)

I've tested this a few times and have some log files that show different behaviour. This is most easily tested using a plugin such as Custom Reports.

For example, when leaving the setting as standard (6 months) we get the following in the core:archive logs after creating a new Custom Report for the Year period:
�[32mINFO [2021-11-10 22:57:43] 3657435 �[39m Archived website id 1, period = year, date = 2021-01-01, segment = '', 284 visits found. Time elapsed: 5.700s
(Note the lack of plugin = CustomReports)

Setting this to a longer period such as 12 months, we see that the plugin report itself is processed:
�[32mINFO [2021-11-10 23:01:57] 3686930 �[39m Archived website id 1, period = year, date = 2021-01-01, segment = '', plugin = CustomReports, report = 27, 284 visits found. Time elapsed: 0.527s

However, when we set the period to something much longer, such as 48 months we see the following output in the logs for the current year:
�[32mINFO [2021-11-10 23:20:15] 3809322 �[39m Archived website id 1, period = year, date = 2021-01-01, segment = '', 284 visits found. Time elapsed: 5.630s
(Again we note the lack of plugin = CustomReports for this archive run)

In my testing for example, the Year report for 2021 for this newly created report with 48 months of historical data was effectively never processed and showed not data:
image

Possible Solution

I'm not sure if this is perhaps related to when the current "Year" report is considered outdated. It's possible that because we expect the current Year report to be automatically invalidated and processed that we skip the invalidation of the plugin report for that same period. But if the year report was recently processed, then it's possible that it won't get processed for this report.

Steps to Reproduce (for Bugs)

  1. Change the setting for rearchive_reports_in_past_last_n_months to 48 months
  2. Create a new Custom Report
  3. Run core:archive
  4. Check the Year report for the new Custom Report

Context

This has the effect that the "Year" reports for the current year may not be correct. In one customers case the "Year" report only included data since the day the report was created and did not include any of the historical data from earlier in the year.

For reports that were created during the year with this setting, the "Year" report will basically always be incorrect.

Your Environment

  • Matomo Version: Tested on 4.5.0 and 4.6.0(RC)
@Starker3 Starker3 added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Nov 18, 2021
@sgiehl sgiehl added this to the For Prioritization milestone Jul 14, 2022
@justinvelluppillai justinvelluppillai changed the title Historical archiving for plugins doesn't always archive Year period for current year Fix for current year not processed for new custom repors Sep 29, 2022
@justinvelluppillai justinvelluppillai added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants