Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something went wrong in the test. Please check the path and your logs while setting wkhtmltopdf and wkhtmltoimage paths #46

Open
romainpoirier opened this issue Mar 10, 2022 · 6 comments
Assignees

Comments

@romainpoirier
Copy link

romainpoirier commented Mar 10, 2022

Description

I am running Mac OS Monterey 12.2.1 and I am running locally my server using MAMP Pro 6.6.1 + PHP 7.4.21. I followed the plugin install documentation, which is from previous Mac OS / brew version.

I had to run brew install --cask wkhtmltopdf instead of brew cask install wkhtmltopdf. After install, the wkhtmltopdf and wkhtmltoimage paths I get are default one (/usr/local/bin/wkhtmltopdf and /usr/local/bin/wkhtmltoimage).

However, when I save the settings in /admin/settings/plugins/enupal-snapshot I always get this error: Something went wrong in the test. Please check the path and your logs right under the fields. This happens even if I leave the Absolute Binary Path of wkhtmltopdf lib and Absolute Binary Path of wkhtmltoimage lib fields empty, or if I fill them with the /usr/local/bin/wkhtmltopdf and /usr/local/bin/wkhtmltoimage values, or from .env values.

Unfortunately, I see nothing related in the logs, but I can see that PDF and PNG sample files are generated in my assets (both are displaying a sample Hello world). All these settings are lost after save, probably because of the error. While the paths are correct, I don't understand what's going wrong.

On front-end, I did a simple test:

{% set urls = {0: 'https://www.google.com', 1:'http://enupal.com/en'} %}
{%  set settings = {
        filename: 'my-first-pdf.pdf'
    }
%}
{{ craft.enupalsnapshot.displayUrl(urls, settings) }}

Then I get Something went wrong when creating the PDF file, please check your logs, but I can only see this in the logs:

2022-03-10 10:27:39 [-][1][-][error][enupal\snapshot\Snapshot::error] Something went wrong when creating the PDF file: The exit status code '127' says something went wrong:
stderr: "sh: : command not found

Any idea how to setup this? Thank you!

Additional info

  • Craft version: 3.7.36
  • PHP version: 7.4.21
  • Database driver & version: MySQL 5.7.34
  • Plugin version: 1.2.8
@andrelopez
Copy link
Member

Hi @romainpoirier 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 [email protected]

@romainpoirier
Copy link
Author

Hi @andrelopez, I'm sorry as there weren't any solution at the time of this issue, I had to go with another solution. So I can't replicate it as I haven't this setup anymore.

@iamdangavin
Copy link

Digging this one back up because I am having the same exact issue on my local install. Same errors, can't save settings with the path provided from the brew install. Makes a sample PDF in the proper place, but loses all settings if I leave the page.

Email log file

@andrelopez
Copy link
Member

Hi @iamdangavin what is your local stack (how do you run craft cms)?

@iamdangavin
Copy link

Mamp Pro (php 8.0.8), Codekit, Craft CMS (4.2.5.1). Site is stored in /Sites/_labs/{domain.com}/

@iamdangavin
Copy link

iamdangavin commented Oct 12, 2022

@andrelopez seeing if you had any thoughts or updates on this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants