Closed jloh closed 13 years ago
Attachment: First Screenshot screenshot 1.png
Attachment: Second Screenshot screenshot 2.png
Did you check your mail configuration by clicking on "Send Report Now" ?
Are you running Piwik 1.1.1? This fix went in for php 5.1.x: [3617]
Sorry, the title of this ticket is wrong. It should be weekly* not daily basis. But I am currently testing on daily trying and get them working.
@JulienM, yes, when I hit "Send Report Now" the reports do send.
@vipsoft, I upgraded to the latest version last night, but no matter what version I've been running they haven't sent. I'm currently running php version 5.2.14
Actually I tried sending a daily report then, the email went through, but the PDF didn't have any information in it. The structure of the file was all their, the tables and such, but no information.
what language did you set your piwik to? maybe you set it to an unsupported language (there are not many left, but a few are not supported by the PDF library and fonts)
My Piwik is currently set to English.
Please post the PDF without any info in it so we can see what you mean.
To summarize, daily PDF is empty but is sent, and weekly/monthly PDF don't send at all?
Ah. Turns out the PDF's do show content, Google reader was stuffing up.
Sorry about the confusion, my explanation is very messy.
Pretty much when I schedule reports to send no matter whether its weekly or daily, I am yet to test monthly out yet, they do not send. Yet when I click "Send Report Now" they do send. My settings are still set to as they were above on the attachment. Sorry for all the confusion.
Make a little bit more sense now?
We are also experiencing the same issue with Pwiki 1.1.1. Reports are set up to send daily but never send. If we click the "Send Report Now" button, it works without error.
If there's any workaround or further information we can provide to help debug the issue please let us know!
Questions
Hi matt, I have 'enable browser to trigger archiving' set to yes I'm pretty sure. And I don't have a cronjob setup.
See bolero's patch in http://forum.piwik.org/read.php?2,71473,page=1#msg-71752
On second thought it seems that the original "if(strlen($piwikHost) == 0)" is meant as a fix for this problem. But it fails because getCurrentHost allows for passing a parameter and has a default value of "unknown". I assume that "unknown" is used elsewhere, or maybe just some Piwik code convention. The author of the PDF plugin wasn't aware of this and checks for an empty string - makes sense. There are at least three solutions.
public function setFrom($email, $name = null)
{
$piwikHost = Piwik_Url::getCurrentHost();
if ($piwikHost == "" || $piwikHost == "unknown")
$piwikHost = $_ENV['HOSTNAME'];
$email = str_replace('{DOMAIN}', $piwikHost, $email);
parent::setFrom($email, $name);
```}
2. pass in the host (which may create other problems, e.g. overwrite values)
3. change getCurrentHost in Url.php. The $default='unknown' doesn't make any sense to me. You cannot pass a $default parameter there, because it would get set to $_SERVER[later, anyway. So, you always end up with "unknown" or $_SERVER['HTTP_HOST']('HTTP_HOST']). (Unless you run via cron *and* pass something in, but this isn't done.)
Proposed change:
static public function getCurrentHost()
{
...
if(isset($_SERVER['HTTP_HOST']))
{
$default = Piwik_Common::sanitizeInputValue($_SERVER['HTTP_HOST']);
}
elseif ($_ENV['HOSTNAME'])
{
$default = Piwik_Common::sanitizeInputValue($_ENV['HOSTNAME']);
}
else
{
$default = "unknown";
}
...
}
Btw, I don't understand this construct:
static $hostHeaders = null; if(is_null($hostHeaders))
Isn't that always to be true, anyway?
I have found that this will not always work. I thought it worked, but I guess I still had the hard-coded FQDN in the code.
$_ENV['HOSTNAME']
gets the hostname if run on the command line. However, via cron it seems to be empty. I'm too lazy zu troubleshoot this any further. I just changed the code to set a given hostname if there's still an empty $piwikHost at the end.
So, there should be an option that always fills in an appropriate FQDN if it's still empty.
Possible solutions:
What if you usephp_uname('n')
to get the host name?
php_uname seems to have a bug. I get "host" only, no matter if I use 'n' or even 'a' ! Version is 5.2.16
Oh, wrong usage. I thought I could get a direct output from this command on the command line. I added it to Mail.php, let's see tomorrow.
I am so confused right now...
Ok, "$piwikHost = php_uname('n')" in Mail.php (=solution 1. above) works for cron. Do you want to go with solution 1., 2. or 3.? I can test No. 3 as well if you want. Something like
static public function getCurrentHost()
{
...
if(isset($_SERVER['HTTP_HOST']))
{
$default = Piwik_Common::sanitizeInputValue($_SERVER['HTTP_HOST']);
}
elseif (isset($_ENV['HOSTNAME']))
{
$default = Piwik_Common::sanitizeInputValue($_ENV['HOSTNAME']);
}
else
{
$default = php_uname('n'); //not necessary to sanitize?
}
...
}
Alright, I just changed my mail.php and I just setup a cron job. I'll get back to you soon!
Is there any update on this? Is there a proposed patch for trunk? please attach :)
There was no answer to my question if I should test solution 3 as well. Won't test solution 3 if you want to use solution 1. I'm running with solution 1 now. I can test solution 3 if you want to implement it. I think that's the preferred way to do it (it fixes the problem at the source), but I don't know what you prefer.
I've tried using solution 1 but I don't my host likes cron jobs much, that or I'm just retarded in setting it up. Maybe we could try solution 3?
Solution 1 works. You may not have correctly implemmented it. And solution 3 is outlined above. You can just try it.
Do I need to use cron to use it?
No. If you do not use cron I think you do not need either solution. This solution should only be necessary if archive.sh is run by cron because then the environment doesn't include the $_SERVER array which is originally used to get the hostname.
I'll mark it as fixed because I think this is not a bug in 1.2-rc as this code has changed and now we pass piwik.org as parameter to the function.
(In [3936]) Refs #1961 Adding new config parameter to configure the default hostname when it couldn't be detected
To test with this new code, please try 1.2-rc3, more info in: http://forum.piwik.org/read.php?2,72265
I would not pass piwik.org in. You may get lots of botmail to non-existant addresses under piwik.org. I would either pass nothing or "unknown" (as now) or something like @setconfigparameterparametername@example.com. This would trip off people if there is a problem and the latter syntax would even tell them what to do.
(In [3943]) Refs #1961 changing default host from piwik.org thanks for the tip!
Hi guys,
Whilst setting up websites I've set it to email reports to myself, mooash@gmail.com, on a weekly basis. The only problem is, that it doesn't do this. When I hit "Send report now." the report sends, but on Monday it doesn't send. I live in Australia, Tasmania to be exact and my server is hosted in Richmond, Virginia in the USA. I shall attach a screenshot of my current report settings. I don't think whether this is a bug or just me fucking something up somehow, if it is the later then I am sorry in advance!
Cheers,
James Keywords: mail report piwik