createPDF returning errors on a particular Bluehost server

7 posts by 2 authors in: Forums > CMS Builder
Last Post: November 16, 2019   (RSS)

By gkornbluth - November 13, 2019 - edited: November 13, 2019

Hi All,

I guess this is not my week...

Since yesterday, I've been having trouble with createPDF plugin on all sites on a particular Bluehost server.

Most return the error:

Exit with code 1 due to network error: ContentNotFoundError
Error executing wkhtmltopdf! (Exit code: 1)<br/>

If I try to use a proxy server where I know that createPDF works, I get the same error.

On another site on the same server (my cookbook site) I get this error:

sh: /home2/ngpymrmy/public_html/thecmsbcookbook/cmsAdmin/plugins/createPDF1.09/wkhtmltopdf/wkhtmltopdf-0.12.5-1.centos6.x86_64: Permission denied
Error executing wkhtmltopdf! (Exit code: 126)<br/>

All server requirement tests pass on the originating server with either proxy disabled or enabled.

Any thoughts?

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Daniel,

Thanks for the insights.

I'll look at it in the morning.

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gkornbluth - November 15, 2019 - edited: November 15, 2019

Hi Daniel,

I've made a little progress so far, but I really don't understand what's going on with permissions.

After a lot of trial and error it seems that after I removed a link to a missing .css file from the head of the file on the site that threw the "Exit with code 1 due to network error: ContentNotFoundError Error executing wkhtmltopdf! (Exit code: 1)<br/>" error, the file generates PDFs as it should.

Seems Pretty Picky....

As far as changing permissions on the command line, I don't think I can do this on a shared server at Bluehost.

Anything more specific that I can tell them that won't trigger their classic "But it's not a Wordpress site and we can't help with custom coded sites" response?

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By daniel - November 15, 2019

Hey Jerry,

Glad you figured out one of the issues - that is a fairly nitpicky reason to throw an error, but good to know for the future!

Anything more specific that I can tell them that won't trigger their classic "But it's not a Wordpress site and we can't help with custom coded sites" response?

This is a bit trickier, as I don't have any direct experience with Bluehost or what their support considers "in scope." The specific thing you want them to help with is updating the permissions on a file so that it can be executed by a PHP script using the "exec()" function. This line of the error shows specifically where the file is:

sh: /home2/ngpymrmy/public_html/thecmsbcookbook/cmsAdmin/plugins/createPDF1.09/wkhtmltopdf/wkhtmltopdf-0.12.5-1.centos6.x86_64: Permission denied

If this was previously working (and you haven't made any changes to the plugin) then I'd also suggest bringing that up, as it puts the onus on the host to figure out why something that was working on their system no longer is.

If that doesn't lead anywhere, a local permission issue shouldn't stop you from using a different working host as a proxy - if you have one available.

Good luck!

Daniel
Technical Lead
interactivetools.com

By gkornbluth - November 15, 2019 - edited: November 15, 2019

Thanks Daniel,

I'm assuming that this is a different thing then standard read write execute file permission like 0755 or 0644.

Seems that almost any issue is 'out of scope' for them lately. I'll give them a try, but also try the proxy route.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Most of the issues with the createPDF plugin are now resolved, and for anyone else who is finding issues here's what I've discovered so far:

Note that All my PDF Conversions were working before some unknown server changes were made on a particular shared server at Bluehost.

1) Normally, on a list viewer I'd have the code <?php if (@$_REQUEST['pdf']) { createPDF_fromOutput('inline', 'example.pdf'); } ?> at the top of my page after the get records code block.

Then I'd use a link like <a class="your_css_class" href="?pdf=1">CLICK TO CONVERT THIS PAGE TO A PDF</a> to initiate the conversion.

I found that if I was trying to convert an index.php page to a PDF, I'd have to add index.php to the link above, or I'd get 'content not found' errors:

<a class="your_css_class" href="index.php?pdf=1">CLICK TO CONVERT THIS PAGE TO A PDF</a>
2) If any of the links in my page's head section were broken, I'd also get a 'content not found' error.

You can find all the tricks I've learned about implementing the createPDF plugin in my CMSB Cookbook at http://www.thecmsbcookbook.com/recipedetail.php?339

If anyone has any other discoveries or tricks, post them here and I'll add them to the Cookbook

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php