Weekly report sent on Tuesday

A few weeks ago I upgraded from an old Piwik (1.10) to Piwik 2.10.0. The process was very flawless, quite surprising with such a complex package. The only downside was that it showed it would be going to the latest of the 1 series, but then went straight for 2 and didn’t check if that would run under the installed PHP version. So, after the update I had to update PHP as well. I suppose this would have been mentioned in the changelog if I had gone step-by-step. Nevertheless, I would suggest adding a check for supported PHP version to the installer.
Anyway, thanks for this great upgrade experience! Now for the problem.

There is one thing since that upgrade which bugs me a bit. There where weekly email reports scheduled and after the upgrade they started to get sent out on Tuesdays instead of Monday. Hindsight shows with the help of the mail database on the excepting server that before that update the reports were sent out on Monday morning at 1am (April - Sept. 2014 at 2am, then at 1am - probably something to do with daylight time, I have no data from before April). But on an irregular basis and mostly only one weekly report per month. I don’t know why and I didn’t/don’t care too much. I assume there may have been a problem with assigned memory or so. The last weekly report sent was on Jan. 19, 1am, for the week ending Jan. 18. I updated on Feb. 16. The next report was sent on Feb. 23 (Monday!), 0 am, for the week ending Feb. 15 (one week later). Then there were again reports on Tuesday, Feb. 24, 0am, for the week ending on Feb. 22. This seems to fit with this posting: 301 Moved Permanently However, from that day on, it keeps reporting on Tuesdays, 0am. Not missing a week yet. So, the scheduled time seems to have moved from 1 to 0 am (a few minutes after midnight, depending on the time it takes to create the report, 0 is also the time shown in the task) and the day from Monday to Tuesday. Also, the time seems to have been moving for one hour according to daylight time before that, at least in the past. Which shouldn’t be the case I think.
The timezone on the server is set to CEST with daylight settings, at the moment still to CET. I wonder if the whole issue is connected to daylight time and the shift from Monday to Tuesday at 0am. I’ve now edited the task and set the time from 0 am to 1 am.

Thanks for any suggestions.

Hi there,

Thanks for your note. It makes sense that the reports are sent on different server time when timechanges, since the reports are sent after the period is finished in the website timezone (as set in piwik).

if you have identiifed any bug with Piwik scheduled task and the time at which reports are sent, please create an issue at: Issues · matomo-org/piwik · GitHub with info -

Hi Matt, thanks for the answer, but I don’t understand it. Server timezone is set correctly and php timezone is set correctly via php.ini as well. So, they should be identical. Timezone is CET/CEST, btw. What do you mean by “reports are sent on different server time when timechanges, since the reports are sent after the period is finished in the website timezone”.
Should I set a timezone in Piwik? I think I haven’t found such an option yet.
Btw, now that I changed the time from 0 to 1am last week I got this week’s report on the correct day. It was sent on Monday 2:01 (should have been 1 am, though).
But it’s still not clear if it uses the correct time and it seems to think it’s a different time.
It looks like Piwik doesn’t seem to correctly understand the time(zone) on the server. Or there’s really a timezone setting that I haven’t found yet. (Btw. I do have problems with the new interface, for instance each time it takes me quite some time to find the option for the scheduled reports.

Here’s relevant mail headers (Date header included by Piwik):
Date: Mon, 30 Mar 2015 00:01:51 +0000
Received: from localhost (…); Mon, 30 Mar 2015 02:01:51 +0200 (CEST)

So, it is 2 am, but Piwik thinks it’s midnight. Or do I misinterpret this? Ah, wait, if I correct this for the timezone it’s 2 am. The report is scheduled for 1 am.
There were two changes:

  • I set the time from 0 to 1am.
  • Time changed from CET to CEST on Sunday, e.g. from +0100 to +0200 = 1 hour later

If I take the Piwik time Mon, 30 Mar 2015 00:01:51 +0000 (= 1am for Piwik) and deduct that one hour (0am to 1am) I get March 29 = Sunday. Which would not be the correct day. So, it waits one day, which is too late.
Did I make myself clear? I think Piwik doesn’t correctly use the timezone (the timezone, not the Daylight time change). It should also set the Date per timezone and not per UTC.

Update: I changed the 1 back to 0am last week. This Monday I got the report still on 2am (Monday!). I’ve changed it now to 3am. Let’s see what next week happens. Ok, I’m getting it now at 4am.
So,
0am -> 2am
1am -> 2am
3am -> 4am
2am -> let’s see.