Incorrect visitor data after upgrading to v4.2.1

We recently upgraded our Matomo PROD/QA instances to v4.2.1 from v3.14. After the upgrade, we have started noticing issues with visits count for a particular site. Here are some of the facts:

  1. The particular site visit data is uploaded using the Log Analytics script.
  2. We checked the Matomo MySQL database table matomo_log_visit and noticed that the numbers are correct there but the Matomo UI shows drastically lower numbers. Eg: Before upgrade on 3rd May 2021, the visits count was 2230 but the day after the upgrade the number dropped to 354 and has stayed in the range ~200-300 since as opposed to ~2000-3000 before upgrades.
  3. We tried running archival but to no avail.
  4. We checked the logs and no noticeable errors were seen.

Some steps we tried to fix the issue:

  1. We tried running the archive script as follows:
    ./console core:archive --force-all-websites --force-all-periods --force-date-last-n=1000 --url=YOUR_MATOMO_URL_HERE
  2. Migrated the site in question to our QA instance of Matomo – Issue persists
  3. Created a new site, uploaded the same logs using log-analytics – Seems to show the correct visits


This is interesting! It reminded me of the issue I had

Yesterday we migrated a data set to a test server to try and update again to 4.2 and subsequently to 4.3. But once again 4.2 showed incorrect data in the UI.

Not sure if it is the same but if we figure it out I’ll you know

Looks like that one is still not fixed. I downgraded our QA setup to 3.14.1 and things are still fine there.
I had to invalidate and re-upload the logs though.
Unfortunately, we did not notice this issue quick enough because it was affecting only a particular site.

Yeh we could not do that because we didn’t have all the raw data of the missing reports. Invalidating would cause even more loss. So we opted for a full backup restore with no invalidating necessary. This left us with a few days without data. I can live with that. On our test server we are still trying to figure out how to handle this. Because for now we are stuck with an older version like you.