Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

error generating report - mail

johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

error generating report - mail

Unread post by johan »

I've got a problem using mail function.

Mail function gives " There was an error generating the report" .
I'm sure the report is OK because it works with print.

In my form I used (extra action button):

emailIt("rpt3","myadress@host.be","","mail vanuit databank", "","signaal","","pdf")

I got the same problem in a second db.

Thanks for your help.

Johan
You do not have the required permissions to view the files attached to this post.
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: error generating report - mail

Unread post by shane »

If you are running on a Linux host, one thing I would suggest is to make sure that you have write permissions to the following:

{webroot}/productionnu2/temppdf

chmod it to 775
and chown it to either apache:apache or nobody:nobody depending what your webserver runs as.
If you are running a windows host, you will also need to make sure it has folder which can be written to by the web server you are running:
{webroot}\productionnu2\temppdf

Also you might want to make sure that CURL is enabled in your php.ini
And you also need to setup the global config.php file.
{webroot}/productionnu2/config.php

Let me know is this doesn't work
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: error generating report - mail

Unread post by johan »

Shane,

Thanks for your reply. I've adjust the wirite permission (linux) and now I can send email.

Sending Html gives :
Authentication required!

This server could not verify that you are authorized to access the URL "/***/database/productionnu2/runreport.php". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

In case you are allowed to request the document, please check your user-id and password and try again.

If you think this is a server error, please contact the webmaster.
Error 401
When I send a pdf, i got an error opening the file. (file damaged or not been decode correct as mail attachement). I haven't got that problem using pdfit or when I print as pdf.

Thanks for helping me.

Johan
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: error generating report - mail

Unread post by johan »

hi,

the webserver has access to the temppdf and has write access
we still have the same error. we can't send a pdf by email.

we configured access to this website by ldap authentication on the webserver (apache). Can this be a problem?

Johan
You do not have the required permissions to view the files attached to this post.
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: error generating report - mail

Unread post by shane »

I think the problem is to do with the URL of the report you are trying to send as an attachment.

nuBuilder needs to call the full url of the report in the background and then write this to a file in the temppdf folder. After this it can then be attached to an email.
In your case, it sounds like the file is being written to the temppdf folder and then added as an attachment, but the PDF/HTML is corrupt.

This normally means that the problem is happening at the point that the report URL is being call by nuBuilder. If there is an error in calling the URL, nuBuilder will not catch this, it simply writes the result into the file, then attaches the file and sends the email.

It sounds like you have enabled some additional web server authentication on the nuBuilder URL. Can you try this with the authentication removed?

If it is not the authentication then it could SSL that is the problem.

If you are have a url which has https in front of it, but the certificate for https is not valid or self sign, then the CURL component in PHP will generate an error. The PHP error message is what gets sent to the PDF file, which of course means that is no longer a valid PDF.

There are a couple of ways to resolve this:
1) Make sure you have a valid SSL certificate
2) Edit reportemail.php and change the CURL options to accept a non valid SSL
3) Or, if the SSL certificate is valid, your CURL PHP settings might need checking.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: error generating report - mail

Unread post by johan »

Shane,

Sorry it took so long but I'm still looking for a sollution on this one.

We don't use https but http.

Can I verify which URL is called to create the attachement? Is there a different between the report generated to print or the report attached to the mail?

In my report that i print it is the complete url (on top of my page).

Thanks again,
Johan
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: error generating report - mail

Unread post by shane »

The url is the same you would see in your browser, however do you have additional authentication on your server, where the web-server is asking for a username and password?
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: error generating report - mail

Unread post by johan »

Shane,

we use authentication on our server via apache and ldap.

Johan
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: error generating report - mail

Unread post by shane »

In order to see if this is the problem, can you try it with the authentication turn off.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: error generating report - mail

Unread post by johan »

Shane,

I've turned the authetication off. Now it works fine. So the problem seems to be the autentication (or apache?).

Of course i wan't the autentication back on.

johan
Post Reply