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
PDF generation fails: wkhtmltopdf ConnectionRefusedError #36018
Comments
see also:
When setting to 127.0.0.1 I get the content not found error as here: |
Duplicate frappe/frappe#23958 possible fix: host_name should be public facing host name and not local IP. |
I have the same issue. SOLUTION. When setting the host_name ONLY the url must be set. Never include http:// or https://. |
Information about bug
There are many issues raised in the past about generating PDFs with wkhtmltopdf, I have been playing around with different troubleshooting options - and I believe I have conceptually figured out the solution but don't know enough Python or about ERPNext to resolve it:
Changing
host_name
insites/[sitename]/site_config.json
from my actual host/domain name to"https://127.0.0.1:443"
or"http://127.0.0.1:80"
allows wkhtmltopdf to work, but it then breaks OAuth for logging in via Office365, links in the footer of emails to open the documents online, etc. - basically, anywhere the host name value is factored in.I believe we need to dynamically replace the hostname being passed to wkhtmltopdf from the PDF button from the actual hostname to the localhost
Sources:
https://discuss.frappe.io/t/pdf-printing-issues/97832/3
https://discuss.frappe.io/t/wkhtmltopdf-error-creating-pdf/101926/8
https://discuss.frappe.io/t/oserror-wkhtmltopdf-reported-an-error-exit-with-code-1-due-to-network-error-sslhandshakefailederror/96029/1
Follow-on issue - this issue makes it impossible to send emails from the system as wkhtmltopdf doesn't let them go through
I'm using the Bitnami VM for ERPNext
Module
accounts, stock, buying, selling, ecommerce, manufacturing, HR, projects, support, CRM, assets, integrations, quality, regional, portal, agriculture, education, non-profit, other
Version
Akwad UI Fixes: v1.0.4
Desk Navbar Extended: v0.0.1
ERPNext: v14.28.1
ERPNext OCR: v1.0.1
Frappe Framework: v14.40.1
Frappe M365: v0.0.1
Frappe Insights: v0.6.2
Microsoft Integration: v0.0.1
One Compliance: v0.0.1
Payments: v0.0.1
SCS Sales-Purchase: v0.0.1
Simple Stock: v0.0.1
Wiki: v2.0.0
Installation method
manual install
Relevant log output / Stack trace / Full Error Message.
The text was updated successfully, but these errors were encountered: