Problem with custom date range report (Piwik returns the wrong totals)


I’m currently having a problem when creating a report with a custom date range of 3 months (1st of January - 31st of March) in Piwik.
The final report omits the totals for the 3rd month entirely, only taking into account the first 2 months of the date range.
Though when creating a report for those 3 months separately, the correct totals are returned for each month.

My guess would be that there is a cached version of this specific report (01.02.2013 - 31.03.2013) with the wrong numbers somewhere.
I’ve tried deleting a couple of things under piwik/tmp/*, but this didn’t solve the problem.
So my next guess would be that it’s cached somewhere in the database.

How can I fix this and get Piwik to return the correct numbers for this 3-months-report?
Is it possible to get Piwik to empty out the cache and generate a report again from scratch or anything like that?

Also a short backstory which might help in solving this problem:

This particular problem was first noticed when it was discovered that the month of March was showing up with a total of 0 requests in Piwik.
This has since been fixed - because of the “memory exhausted” error when running the job via crontab, the archiving process didn’t work correctly from mid-March until today. But after allocating more memory in php.ini, I was able to get the archiving process up and running again.
So basically, the stats for the month of March were incomplete up until today.
I’d assume that’s why Piwik has some wrong stats cached somewhere.

Thanks in advance!

Maybe it is the same as this bug?
if so post a comment there as well maybe.

But also make sure you use the archive.php script:

Hi matt,

thank you for your reply.

Yes, it does look like that this bug caused the problem.
Since archiving didn’t work up until this day, the data was returned as 0 for the month of March.

But it seems now that my Piwik installation healed itself over the weekend.
I tried creating the report with the same date range again today (January-March), and now it works fine.
The correct totals are now returned for this one report.

I’d assume that there was only a cached version of the wrong report somewhere for this particular day.
I’m not entirely sure how Piwik works under the hood, but could it be that reports are only generated once a day and are then cached in the database?
Since after waiting a couple of days, the report was generated correctly again.