Welcome! Log In Create A New Profile

Advanced

Fatal Error ....PDFCrowd/pdfcrowd.php on line 350

Posted by zanart 
Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
June 28, 2012 01:41AM
Hi
I have been using PDF crowd to attach a pdf invoice to order confirmation email for a while and it works as expected 95% of the time. However there is an occassional fatal error. I cannot recreate the problem using the same data. Can anyone shed any light on this error:
Fatal error: Uncaught exception 'PdfcrowdException' with message 'name lookup timed out' in ..shop/core-private/PDFCrowd/pdfcrowd.php:350 Stack trace: #0 ..shop/core-private/PDFCrowd/pdfcrowd.php(72): PdfCrowd->http_post('http://pdfcrowd...', 'username=zanart...', Resource id #73) #1 ../shop/core-private/apps/ecom/ECOM_Order/ext/0920_mailcustomer.php(161): PdfCrowd->convertHtml('??<div class="c...', Resource id #73) #2 ../shop/core-private/apps/ecom/ECOM_Order/ECOM_Order.php(1390): ECOM_Order_mailcustomer->exec(Array) #3 ../shop/core-private/apps/ecom/ECOM_Order/ECOM_Order.php(1596): ECOM_Order->do_orderprocess(Array) #4 ../shop/core-private/core/CORE_App/CORE_App.php(923): ECOM_Order->ordertasksp() #5 /homepages/36/d314567840/htdocs/EZEFRAMENEW/shop/core-private/core/CORE_App/C in ../shop/core-private/PDFCrowd/pdfcrowd.php on line 350


Thanks
Rob
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
June 28, 2012 03:59AM
Rob,

Possible reasons why you are getting this error are:

1/ Your application is not having a working internet connection occasionally.
2/ The DNS server you use is not able to resolve the pdfcrowd.com domain correctly. Reach out to your system administrator or hosting provider for help.

Also, Google may give you more information on this issue.
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
June 28, 2012 04:58AM
Thanks

I await a response from the hosting provider.
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 04, 2012 05:07AM
1and1 have advised this is a software issue and they are unable to help.

Can you offer any further advise as I cannot continue using PDFCrowd with this problem.

Thanks
Rob
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 04, 2012 05:52AM
Rob,

in that case the workaround is to bypass the DNS lookup. Go to your copy of pdfcrowd.php and replace the following line
public static $api_host = 'pdfcrowd.com';
with
public static $api_host = '69.164.218.62';

Please let us know if it helps.
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 04, 2012 06:00AM
That gives me a permmanent error:

Fatal error: Uncaught exception 'PdfcrowdException' with message 'Empty reply from server' in ../PDFCrowd/pdfcrowd.php:350 Stack trace: #0 ./PDFCrowd/pdfcrowd.php(72): PdfCrowd->http_post('http://69.164.2...', 'username=zanart...', Resource id #72) #1 ../apps/ecom/ECOM_Order/ext/0920_mailcustomer.php(161): PdfCrowd->convertHtml('??<div class="c...', Resource id #72) #2 ../apps/ecom/ECOM_Order/ECOM_Order.php(1390): ECOM_Order_mailcustomer->exec(Array) #3 ../apps/ecom/ECOM_Order/ECOM_Order.php(1596): ECOM_Order->do_orderprocess(Array) #4 ../core/CORE_App/CORE_App.php(923): ECOM_Order->ordertasksp() #5 ../core/CORE_App in ../PDFCrowd/pdfcrowd.php on line 350
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 04, 2012 06:10AM
Please rollback that change.
Are you on a shared hosting or do you have your own server? If the latter, which operating system do you run on?
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 04, 2012 06:19AM
Dedicated server
Linux infong 2.4 #1 SMP Tue Jan 17 02:58:41 UTC 2012 i686 GNU/Linux

Thanks
Rob
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 04, 2012 06:51AM
Please try the following (in this order):

1/ Add the following line to the http_post() function in pdfcrowd.php. There already is a block of code that calls curl_setopt() so just append it to that block.
curl_setopt($c, CURLOPT_DNS_USE_GLOBAL_CACHE, false);

2/ If the above does not help then bypass the DNS lookup by adding a record for pdfcrowd.com to your /etc/hosts file - open /etc/hosts in a text editor as root and append the following line:
69.164.218.62 pdfcrowd.com

Please let us know if this fixes the issue.
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 04, 2012 07:00AM
I am testing no 1 - no fatal errors.
I will let you know if the problem is resolved.

Thanks
Rob
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 06, 2012 06:09AM
Hi
Option 1 seems to have solved the problem completely.
I will update if any further issues.

Thanks for your support.

Rob
Re: Fatal Error ....PDFCrowd/pdfcrowd.php on line 350
July 06, 2012 03:32PM
Rob,

thanks for reporting it back to us. We will use this setting in the future releases of pdfcrowd.php.
Sorry, only registered users may post in this forum.

Click here to login