add this test code in
function dailySchedule()
{
// flag here
$myFile = “/home/flag_dailyschedule.txt”;
$fh = fopen($myFile, ‘w’);
fwrite($fh, ‘ok’);
fclose($fh);
// end flag
$this->generateAndSendScheduledReports(‘day’);
}
delete tmp/cache/tracker/general.php
Open your homepage
Delete the flag
// flag here
$myFile = “/home/flag_dailyschedule.txt”;
$fh = fopen($myFile, ‘w’);
fwrite($fh, ‘ok’);
fclose($fh);
// end flag
You should have the tmp/cache/tracker/general.php again
Do you have the file flag_dailyschedule.txt created?
Karsten, I’m not convinced that it is the emailing step that fails for you. The PDF report is saved in the piwik tmp directory before the message gets created and sent. I told this before and asked to look there. As you didn’t tell us that you had reports piling up there I assume you don’t. Which means the report isn’t getting created. That’s a step before the sending. Did you check your php error log? If you don’t have one set logging to a file in php.ini.
It’s /path/to/piwik/tmp that would contain it. You do have a php error log? If there is an error it won’t be in any system log. Maybe you need to make it more verbose.
Please note that there’s no try-catch around that report = Piwik_API_API::getInstance()->getProcessedReport().
In /plugins/API/API.php, function getProcessedReport() which is called by above code:
try {
/** @var Piwik_DataTable */
$dataTable = $request->process();
} catch(Exception $e) {
throw new Exception("API returned an error: ".$e->getMessage()."\n");
}
Within the catch you throw another exception, but that’s not catched from PDFReport/API.php as there is no try/catch-block.
In my case, the API want’s to throw an exception ('No entry is registered for key ‘logger_message’.), but that did not work and the script breaks.
Sidenote: For some strange reasons, there is no php errorlog on my server and the apache errorlog is ok. I’ll look into that.
Karsten, it’s the default to have no php error log. But it’s good hoster practice to set one in php.ini, it’s really helpful for getting a feeling of what’s going on. That’s why I have it on all my servers
the mails are generated. But each time the script tried to throw an exeption before, it now generates an empty PDF and could not find a Site-Name.
I suppose before calling Piwik_API_API::getInstance()->getProcessedReport(), I will have to check each parameter. It only set has to be set, but it has to have a valid value. Right now I do not know which values are expected by the method, so I have to investigate a little more…
Yes, maybe the $idSite is empty, maybe something else. I think you didn’t say in the orginal message if this is new to piwik 1.2 or if you just started using it. I don’t know if code in this specific area was changed, but some PDF scheduling code definitely got changed with the last release in order to fix other “no send” issues. I’ll see next Monday if our reports still work …
I can now confirm that the new code works for us. I got the first report this morning.
Thanks for the report - we fixed a bug where PDF reports created for websites that are now deleted cause the automatic schedule to fail to send emails. Please test the patch (2 lines) in: http://dev.piwik.org/trac/changeset/4458 and report if you’re still not receiving PDF reports
Hi Matt,
No luck, http://dev.piwik.org/trac/changeset/4458 did not work for me.
Sorry, but I abandon. Switching to another machine, where Cron is available. :-/