Hi everyone,
I’m facing a persistent PDF generation error in ERPNext / Frappe v15 when downloading print formats or sending emails with PDF attachments.
Environment
-
OS: Ubuntu 22.04 (Jammy)
-
Python: 3.12
-
Frappe: 15.56.0
-
ERPNext: 15.50.1
-
wkhtmltopdf: 0.12.6.1 (with patched Qt)
-
Installed via:
wkhtmltox_0.12.6.1-2.jammy_amd64.deb -
Binary location:
/usr/local/bin/wkhtmltopdf
Error
When downloading a PDF or sending Email Queue with print attachment:
OSError: wkhtmltopdf reported an error:
Fontconfig error: No writable cache directoriesExit with code 1 due to network error: SslHandshakeFailedError
Traceback (shortened)
frappe.utils.pdf.get_pdf → pdfkit.from_string → wkhtmltopdf → Fontconfig error: No writable cache directories
What I’ve already verified / tried
-
Correct wkhtmltopdf version (patched Qt) -
fontconfiginstalled -
/var/cache/fontconfigexists and is writable -
Cache files present in /var/cache/fontconfig -
Fonts installed (fonts-dejavu) -
fc-cache -fvruns successfully -
Permissions fixed: -
Same error occurs when running via Frappe (print format / email queue)
Despite this, wkhtmltopdf still fails with “No writable cache directories”.
Question
Has anyone encountered this issue on Ubuntu 22.04 + Python 3.12 + Frappe v15?
-
Is there a known fontconfig path issue?
-
Does wkhtmltopdf need explicit
FONTCONFIG_PATHorXDG_CACHE_HOMEfor Frappe? -
Any known fixes specific to Jammy or Python 3.12?
Any guidance would be appreciated ![]()
Thanks!