Ask questionsRegression: some daily reports disappear from UI, and weekly reports are corrupted
Hello,
We think PR https://github.com/matomo-org/matomo/pull/17216 has introduced some regressions to the archiving process since Matomo 4.2.0
FYI, browser archiving is disabled:
enable_browser_archiving_triggering = 0
browser_archiving_disabled_enforce = 1
archiving_range_force_on_browser_request = 0
For a given plugin, we are facing 2 issues since the update to Matomo 4.2.0,
delete_reports_enable is set to 0This seems to be related to the changes made with the handling of partial archives. Indeed, we have a lot of partial archives in our DB, which doesn't contain the reports of our impacted plugins:
MariaDB [matomo]> select * from matomo_archive_numeric_2021_03 where idarchive = 46176;
| idarchive | name | idsite | date1 | date2 | period | ts_archived | value |
| 46176 | myPlugin | 1 | 2021-03-22 | 2021-03-22 | 1 | 2021-03-23 00:05:52 | 10 |
| 46176 | otherPlugin | 1 | 2021-03-22 | 2021-03-22 | 1 | 2021-03-23 00:05:52 | 20 |
| 46176 | done | 1 | 2021-03-22 | 2021-03-22 | 1 | 2021-03-23 00:05:52 | 1 |
MariaDB [matomo]> select * from matomo_archive_numeric_2021_03 where idarchive = 56405;
| idarchive | name | idsite | date1 | date2 | period | ts_archived | value |
| 56405 | otherPlugin | 1 | 2021-03-22 | 2021-03-22 | 1 | 2021-04-05 18:52:03 | 20 |
| 56405 | done | 1 | 2021-03-22 | 2021-03-22 | 1 | 2021-04-05 18:52:03 | 5 |
As you can see, myPlugin report is not part of partial archive 56405 (partial because the value of done row is 5), but it is nevertheless selected since Matomo 4.2.0, as ts_archived is more recent.
Since https://github.com/matomo-org/matomo/pull/17216, checkAuthorizedToArchive = false is passed to Rules::getSelectableDoneFlagValues during the retrival of archive to display in the UI
https://github.com/matomo-org/matomo/blob/2c30dc8d231af58cdf2516a413da2d86bf7d62c6/core/DataAccess/ArchiveSelector.php#L370
As a consequence, both ArchiveWriter::DONE_PARTIAL and ArchiveWriter::DONE_INVALIDATED are added to the list of accepted value. Which explains why archive 56405 is selected instead of 46176 in our case.
https://github.com/matomo-org/matomo/blob/2c30dc8d231af58cdf2516a413da2d86bf7d62c6/core/ArchiveProcessor/Rules.php#L321
Thus, as soon as archive 56405 was created, myPlugin report disappeared from the UI.
I don't think ArchiveWriter::DONE_PARTIAL should be part of the list of accepted values.
We have been able to fix this issue#1 with this PR https://github.com/matomo-org/matomo/pull/17425
Concerning issue#2, we have been able to fix it by reverting the changes done in the same PR to ArchiveSelector::findArchiveDataWithLatestTsArchived, and then invalidating faulty reports and re-running the cron job.
Matomo 4.2.1
Answer
questions
diosmosis
Assuming this was all fixed in 4.3 as we're no issues so far. I'll close this.
Related questions
No questions were found.