PHP Version: 5.2.17
I've noticed whilst running Piwik 1.9-b10 that after running a cronjob the current week/month for websites that haven't received a visit in sometime revert to zero.
Once the website gets a new visit they repopulate to what they should be, IE the stats for the week/month are no longer zero and populate to what they were before.
I've attached images explaining what I mean
Attachment: After 1 visit and the cronjob has been run again after 1 visit.PNG
Do you still experience the issue? what value do you use in Settings> general settings > timeout ? try 3600 ? marking as works-for-me but I can reopen if you think there is a bug, because there might be.
please try with latest version from: http://builds.piwik.org/?C=N;O=D
this bug should be fixed. reopen if you tsill experience issue and you are using 1.9.2-b3 or greater
Just upgraded to the latest beta build. I'll be testing it over the next week or so.
Yeah I'm still having this issue. A website with only 5 vists this week keeps reverting back to zero until I run a --force-all-websites and --force-all-periods archive.
I'm on 1.9.3-b4
(In ) I think this should fix #3438 because indeed there was a bug in the code. Please try with the new archive.php from svn and reopen ticket if you still have this problem after one day running the new archive.php.
I can confirm that I'm still having this issue as well. I'm using the svn archive.php with 1.9.3-b4 everything else
If you want access to my Piwik install then just give me a heads up and I'll give you access
It didnt show up here but I committed a fix in: 
Please try to grab the latest archive.php from SVN: https://github.com/piwik/piwik/blob/master/misc/cron/archive.php
Then wait 24 hours and it should work OK!
I leave the bug opened, but please close it if you find it's working for you since I think it is now fixed! thanks for your help testing
What would be very help ful would be to store all archive.php output logs appended after another in the log file. To do so replace < with << in the cron line.
Then, can you send the lines from the archive.php run that show that the website that had visits was still not re-processed when it should have been?
Hope it's not too complicated. I would really like to understand and fix this bug!
I'll change this in my cronjob later tonight.
@phoenix thanks that is very interesting. What timezones are your websites set to in piwik ?
also can you check that your server is at the right datetime ? also check that the mysql server is at the same datetime as php server ?
If all is good on your side i'll investigate further for sure, I'm really curious what the bug could be.
I've been logging the archive output, it doesn't show any errors. However I'm still needing to run the --force-all-websites --force-all-periods every now and then. It doesn't look like I'll be much help.
I'm still in the same boat, a website will revert to zero but once it gets a visit it returns to what it should.
I've found an error! See here!
My stats have since been reverted to zero for all websites but one. I assume this error caused an issue?
Also sorry, I got this as well but I assume thats meant to be there. This code I'm adding now did not appear when the code I posted above appeared. They happened on different archive attempts.
[2012-11-24 00:03:33] [48abce63] task,output Piwik_CoreAdminHome.purgeOutdatedArchives,Time elapsed: 1.076s Piwik_PDFReports.dailySchedule,Time elapsed: 1.807s Piwik_PrivacyManager.deleteReportData,Time elapsed: 0.002s Piwik_PrivacyManager.deleteLogData,Time elapsed: 0.000s Piwik_CoreAdminHome.optimizeArchiveTable,Time elapsed: 4.151s
Its worth noting that I have Piwik set to NOT delete old visitor data or anything. Piwik doesn't delete anything from my database.
I think it might be the scheduled task Piwik_CoreAdminHome.purgeOutdatedArchives that would purge too much data, but I'm not sure. I haven't yet been able to reproduce the issue myself. Keep posting more info if you have!
Thats weird, because I don't have purge old log data on. So it shouldn't actually be purging anything...
I think I may have found what could be causing the problem. I tracked a few proxies using Piwik that generated a whole new URL each time they visited a different page so I was literally tracking thousands of different pages a day.
I've since fixed this issue but my stats are still reverting, is there a way I can go through a change all the proxies's pages that start in browse.php to JUST browse.php so that there is alot less pages in Piwik?
you could write a SQL query that will look for all pages in log_action containing browse.php? and delete these IDs from log_link_visit_action (delete these page views). sorry wont write SQL & test, but if you need help: http://piwik.org/consulting/
Sorry, but this issue appears to still be present.
I've noticed the issue happens when it does its daily tasks which are as follows:
[2013-01-20 01:00:09] [7bfe734c] task,output Piwik_CoreAdminHome.purgeOutdatedArchives,Time elapsed: 3.076s Piwik_PDFReports.dailySchedule,Time elapsed: 2.372s Piwik_PrivacyManager.deleteReportData,Time elapsed: 0.002s Piwik_PrivacyManager.deleteLogData,Time elapsed: 0.000s Piwik_CoreAdminHome.optimizeArchiveTable,Time elapsed: 1.671s
Could it be that it doesn't have sufficient MySQL privileges or there is something wrong with my MySQL installation? I'm running it on a cPanel server so it could be that cPanel is locking it down to much.
Whats also interesting is that I've got Piwik set to delete nothing, I retain all data, but it still purges outdated archives? I assume this just means that it updates them or does it delete them?
purgeOutdatedArchives should only remove the "partial" reports which were processed for "unfinished days". do you still experience the issue using Piwik 1.12-beta5 here: http://builds.piwik.org/piwik-1.12-b5.zip
If so please re-open and thanks for your patience