This is an archived forum post. The information may be outdated. Contact us if you have any questions.

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

zanart wrote on 2012-06-28:
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
support wrote on 2012-06-28:
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.
zanart wrote on 2012-06-28:
Thanks

I await a response from the hosting provider.
zanart wrote on 2012-07-04:
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
support wrote on 2012-07-04:
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.
zanart wrote on 2012-07-04:
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
support wrote on 2012-07-04:
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?
zanart wrote on 2012-07-04:
Dedicated server
Linux infong 2.4 #1 SMP Tue Jan 17 02:58:41 UTC 2012 i686 GNU/Linux

Thanks
Rob
support wrote on 2012-07-04:
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.
zanart wrote on 2012-07-04:
I am testing no 1 - no fatal errors.
I will let you know if the problem is resolved.

Thanks
Rob
zanart wrote on 2012-07-06:
Hi
Option 1 seems to have solved the problem completely.
I will update if any further issues.

Thanks for your support.

Rob
support wrote on 2012-07-06:
Rob,

thanks for reporting it back to us. We will use this setting in the future releases of pdfcrowd.php.
whyknott wrote on 2016-05-10:
I'm getting the error "Pdfcrowd Error: [6] name lookup timed out" when I click on one of my Print & Download buttons, it worked before and other site plans work but this one won't for some reason I have no idea why. In Wordpress I set it up the exact same way as all the other neighborhood site plans!!! Any help with this error would be appreciated and this was the closest post I could find to my issue.

Here is the link that gets generated with the error:

http://jamyershomes.com/wp-content/themes/ja_myers/inc/generate-pdf-neighborhood.php?pdf=http://jamyershomes.com/neighborhood/oxford-glen/?pdf

Here is the page that you click the Yellow "Print & Download Site Plan" button:
http://jamyershomes.com/neighborhood/oxford-glen/#tab-item=#tab-2

Thanks!
whyknott wrote on 2016-05-10:
I apparently solved my own issue, it was Wordpress related not PDFCROWD. I had to delete the existing page, create a new one and rename the url to something unique from the original and now the PDF launches perfectly!!