@anonymous-piwik-user opened this Issue on March 17th 2014

I run multiple large websites so i use crontab to do cron jobs, it stopped working after i updated to 2.1.0 trough the web interface.

I get the following on multiple instances on piwik i use after accessing https://stats.mywebsite.com/misc/cron/archive.php?token_auth=mykeyhere

See attached
Keywords: cron

@anonymous-piwik-user commented on March 17th 2014

I could not attach file, so i used pastebin http://pastebin.com/MVFd7Gis

@hpvd commented on March 17th 2014

maybe this is related to
to #4780
?

@anonymous-piwik-user commented on March 17th 2014

Replying to hpvd:

maybe this is related to
to #4780
?

I read that one before i wrote this one, i don't think that one relates as it has to do with timing, in this case it wont process at all. But who knows

@anonymous-piwik-user commented on March 20th 2014

Pretty sure the issue is with the cleanupNotRemovedFiles() function calling a foreach loop on the variable $files. There needs to be a check if $files is empty before calling the foreach loop, as shown below. This fixed the error for me:

public static function cleanupNotRemovedFiles()
{
    $timeOneWeekAgo = strtotime('-1 week');
    $files = _glob(self::getTmpPath() . '/*');
    if(empty($files)) {
       return;
    }
    foreach ($files as $file) {
        $timeLastModified = filemtime($file);

        if ($timeOneWeekAgo > $timeLastModified) {
            unlink($file);
        }
    }
}
@mattab commented on March 21st 2014 Owner

Thanks for the report! fixed and available in latest beta

https://github.com/piwik/piwik/commit/4ec3413635f43d552b8d50944615533cfe341f8f

@mattab commented on April 1st 2014 Owner

In 99ff035e0893806945d7e0216f0a8fdbc11c757a: Fixes #4866 @ldrrp Can you please try this patch and confirm it fixes the issue for you?

This Issue was closed on April 1st 2014
Powered by GitHub Issue Mirror