1

I keep having issues when trying to save the settings for Enupal Snapshot at Craft Nitro, enter image description here

Below is the error message I found at the log file,

[enupal\snapshot\Snapshot::error] Something went wrong when creating the PDF file: The exit status code '127' says something went wrong:
stderr: "sh: /usr/local/bin/wkhtmltopdf: not found

[error][enupal\snapshot\Snapshot::error] Something went wrong when creating the Image file: The exit status code '127' says something went wrong:
stderr: "sh: /usr/local/bin/wkhtmltoimage: not found

I have installed the wkhtmltopdf at Ubuntu 20.04 based on the documentation and get the path using 'which wkhtmltopdf', 'which wkhtmltoimage' enter image description here

I have also enabled the Public URL for the asset, enter image description here

How can I fix this?

I'm using Nitro 2 at Window 10 x64, below are my system details,

Ubuntu 20
PHP version 7.4.16
OS version  Linux 5.4.72-microsoft-standard-WSL2
Craft Pro 3.6.13
Enupal Snapshot 1.2.8
2
  • I'll try to install snapshot on nitro2. I'll back to you soon
    – Andre L.
    Jul 14 at 9:11
  • @AndreL. Thanks.
    – Lee
    Jul 15 at 2:25
2

The issue is because wkhtmltopdf wasn't installed on the right server. I need to install the package inside the nitro server by ssh into the root of the container.

Here is the steps,

nitro ssh --root 
apk add  --no-cache --repository  http://dl-cdn.alpinelinux.org/alpine/v3.10/main/ wkhtmltopdf=0.12.
6-r0

wkhtmltopdf=0.12.6-r0 is the version.

You might need to update your package if you fail to install,

apk update

After your installation, you should be able to get the path,

which wkhtmltopdf 
which wkhtmltoimage

In case you want to check your version, you can run the below command after getting your path,

/usr/bin/wkhtmltopdf --version

Here is the reference, https://stackoverflow.com/questions/59026248/how-to-install-wkhtmltopdf-on-docker-ruby-2-5-1-alpine-linux

1
  • 1
    Keep in mind that this will get blown away if you ever update the container Jul 31 at 13:07
1

Was the value you got from which whtmlopdf $whtmlopdf? Return code 127 is

Value 127 is returned by /bin/sh when the given command is not found within your PATH system variable and it is not a built-in shell command. In other words, the system doesn't understand your command, because it doesn't know where to find the binary you're trying to call. https://stackoverflow.com/questions/1763156/127-return-code-from

So I'm thinking it has something to do with that. I had a few issues getting it setup so am happy to try and help.

1
  • Basically the system not able to detect the path for whtmlopdf, which I have installed
    – Lee
    Jul 15 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.