enupal / snapshot

PDF or Image generation from a URL or HTML page easily for Craft CMS
https://enupal.com/craft-plugins/enupal-snapshot/
Other
11 stars 3 forks source link

snapshot not accepting to path to wkhtmltopdf + nitro #43

Closed paulmendrik closed 2 years ago

paulmendrik commented 3 years ago

Hi Andre,

Sorry to bother you again, but I don't seems to get snapshot to accept the path to path to wkhtmltopdf ev en though I've followed the instructions exactly wkhtmltopdf is installed on the server, when I use the command pwd, I get /home/ploi/wkhtmltox/bin 'ploi' being my server name but adding this path with /wkhtmltopdf or /wkhtmltoimage gives me an error Something went wrong in the test. Please check the path and your logs.and cannot be saved to the settings. I'm not sure what I'm doing wrong here, so can you help ?

Thanks again,

Paul

andrelopez commented 3 years ago

Hi @paulmendrik np, could you please recreate the error and send back to us a zip file of the following folder? storage/logs

Please send the file to support@enupal.com

shoored commented 3 years ago

@paulmendrik Did you get this resolved? I got in touch with the same issue regarding a local Craft Nitro setup.

mmc501 commented 3 years ago

@shoored I had a similar issue a few days ago. Does the Upload Location in the Enupal Settings have a public URLs enabled? If that's not enabled it doesn't seem to save. I've been trying to have the pdf's generated in a secure folder location but have been unsuccessful so far.

chocolayin commented 3 years ago

I'm having the same issue with local Craft Nitro too. Any solution? The plugin doesn't accept the path provided.

mmc501 commented 3 years ago

I'm having the same issue with local Craft Nitro too. Any solution? The plugin doesn't accept the path provided.

I found the issue in my case was that the volume which was selected in the Upload Location below where you enter the path needs to have public url's enabled.

chocolayin commented 3 years ago

I'm having the same issue with local Craft Nitro too. Any solution? The plugin doesn't accept the path provided.

I found the issue in my case was that the volume which was selected in the Upload Location below where you enter the path needs to have public url's enabled.

I have enabled it. But still not working.

andrelopez commented 3 years ago

@chocolayin could you please recreate the error and send back to us a zip file of the following folder? storage/logs

Please send the file to support@enupal.com

chocolayin commented 3 years ago

@chocolayin could you please recreate the error and send back to us a zip file of the following folder? storage/logs

Please send the file to support@enupal.com

Sure, I have sent the logs file.

johnwbaxter commented 3 years ago

@andrelopez Same problem here, it doesn't work in Craft Nitro. Do you have any updates on this?

johnwbaxter commented 3 years ago

@andrelopez This is the relevant log text

2021-09-09 12:02:50 [-][1][-][error][enupal\snapshot\Snapshot::error] Something went wrong when creating the Image file: The exit status code '127' says something went wrong:
stderr: "sh: /app/vendor/h4cc/wkhtmltoimage-amd64/bin/wkhtmltoimage-amd64: not found
"
stdout: ""
command: "/app/vendor/h4cc/wkhtmltoimage-amd64/bin/wkhtmltoimage-amd64" --format 'jpg' --zoom '1.33' '/app/storage/runtime/temp/enupalsnapshottemp/knp_snappy6139e9dad95477.82174487.html' '/app/storage/runtime/temp/enupalsnapshottemp/public/Choice_NzpEGEqdoJ.png'.

The files are all there though.

johnwbaxter commented 2 years ago

@andrelopez Any chance of you taking a look at this? It's been quite a while now....

andrelopez commented 2 years ago

I was able to recreate this issue on nitro, the issue is due that the ubuntu packages are not supported on Alpine (nitro linux distribution) I have tried installing the wkhtmltopdf available on Alpine packages but it looks like is missing some dependencies

// first login as root to nitro
nitro ssh your_container --root 

// then install wkhtmltopdf
apk add --no-cache wkhtmltopdf

I will back when I find a fix to this issue

johnwbaxter commented 2 years ago

Ok, thank you very much for looking into it @andrelopez !!

andrelopez commented 2 years ago

Hi @johnwbaxter could you please try to install wkhtmltopdf on Nitro 2, following the next instructions?

Absolute Binary Path of wkhtmltopdf libRequired: /usr/bin/wkhtmltopdf

Absolute Binary Path of wkhtmltoimage lib /usr/bin/wkhtmltoimage

Please let me know if that works, it's working on my side.

johnwbaxter commented 2 years ago

Hi @andrelopez just to confirm, what is meant to be in "your_container" here: nitro ssh your_container --root ?

Assuming it's the site name? "example.loc" so nitro ssh example.loc --root ?

Assuming that above is correct, It is not working for me,no.

andrelopez commented 2 years ago

@johnwbaxter Yep! the site name.

What is not working ? just the nitro ssh example.loc --root command?

johnwbaxter commented 2 years ago

@andrelopez That all works and I can see the wkhtmltopdf/image libs are in the right place, but, when you try to save those locations it says Something went wrong in the test. Please check the path and your logs. and if i hardcode those paths into project config and try to generate a PDF, it wont create a PDF saying something has gone wrong.

andrelopez commented 2 years ago

@johnwbaxter thanks for following up. Could you please login as root via ssh again and run the following command and hit enter:

apk --update --no-cache add \
   wkhtmltopdf \
    libgcc \
    libstdc++ \
    musl \
    qt5-qtbase \
    qt5-qtbase-x11 \
    qt5-qtsvg \
    qt5-qtwebkit \
    ttf-freefont \
    ttf-dejavu \
    ttf-droid \
    ttf-liberation \
    fontconfig

Let me know if that works

johnwbaxter commented 2 years ago

@andrelopez That works!!!!!

andrelopez commented 2 years ago

@johnwbaxter great! will update the docs soon. Thank you!

johnwbaxter commented 2 years ago

@andrelopez Awesome, thanks Andre!!!

andrelopez commented 2 years ago

In summary, to install Enupal Snapshot on Nitro 2 (may be the same for Alpine Linux distros)

Absolute Binary Path of wkhtmltopdf libRequired: /usr/bin/wkhtmltopdf

Absolute Binary Path of wkhtmltoimage lib /usr/bin/wkhtmltoimage