Archiving of newly created segments since Matomo 4

Hello, since the update to Matomo 4, we are confronted with a behaviour that i tried to get my hands on for the last few weeks now.

After the update to Matomo 4, a newly created segment does not get archived from “beginning_of_time” by the daily cronjob as it should be. The report only contains fresh data from yesterday, but not before. Since we have roughly about 2 years of raw log data, it would be nice to have this included within the new segment report aswell.

To my understanding, the setting process_new_segments_from = “beginning_of_time” withing the global.ini.php should do exactly this, but it looks like the setting is ignored altogether. I also tried to use process_new_segments_from = “last750” but the behaviour stays the same, no historical data within the report of new segments.

I then tried to invalidate the website reports altogether and regenerate them, but no success. I then tried to delete the report tables from the database (dropping tables matomo_archive_numeric_Y and matomo_archive_blob_Y). The next cronjob successfully regenerates the basic report for the website id with the historical data from the last 2 years but again, existing segments and new segments only contain data since “yesterday”.

It is slowly driving me crazy, because it looks very much like it is a bug in Matomo 4. But well, i seem to be the only person with this problem so far.

We have the absolute same issues. I was as well not able to reprocess the archives.
Invidalitation with --segment does not work as well archiving with --force-idsegments.

Looks to be broken?

It seems to be an error.

Short update:

  • Installed new Server with Debian 10
  • Migration of 2 years of historical raw data into new database
  • Matomo Version now patched to 4.2.0

The problem persists, new segments are still not processed from “beginning_of_time”. But there is a workaround: Invalidate reports of new segments.

  1. Install the “Invalidate reports” plugin from marketplace
  2. Create a new segment
  3. Invalidate all historical reports from that segment (they dont exist anyway)
  4. Wait for the cronjob, which will now create reports for this segment using the whole historical raw data

Do not try the option “all segments” when choosing which segments to invalidate, it will just invalidate the websites standard reports then, but not the segments. You have to invalidate each segment seperately to really invalidate the segment. The “all segment” option does not what one expects it to do.

Its not nice, but it works.