Payroll Entry error wkhtmltopdf

Hello i am facing the following error during payroll entry

builtins.OSError: wkhtmltopdf reported an error:

Exit with code 1 due to network error: ConnectionRefusedError.

The wkhtmltopdf package has the job of converting an HTML page to a PDF document. To do that it needs, not only to be able to get the HTML from a local file or remote site, but to load any artifacts that the indicated page imports to alter its visual appearance, eg: images, css, fonts, etc.

I see an <href> to http://mysite.localhost/ where it would collect a necessary CSS file.

Have you checked if that URI actually works?

no it don’t but with my site url its working, can you please tell me where to change the url in the code.

Facing the same issue with v14 and Debian-11

Have you read through the many posts about wkhtmltopdf in this forum?

I had problems with it a couple of months ago and solved it by changing versions. There has been at least one defective release this year.

[ @rachanna ]

Hi @MartinHBramwell ,

Can you say what versions of OS, ERPNext and version of wkhtmltopdf and how installed? Or link to post describing. I’m trying to find binaries of earlier versions that will install on Ubuntu 22.04 but not having any luck. PDF generation does not seem to be working with 13 or 14 on the newer Ubuntu with wkhtmltopdf version 0.12.6-2

admin@erpls:~/frappe-bench-ERPLS$ bench --version
5.12.1
INFO: A newer version of bench is available: 5.12.1 → 5.14.3

admin@erpls:~/frappe-bench-ERPLS$ 
admin@erpls:~/frappe-bench-ERPLS$ bench version
erpnext 13.35.1
frappe 13.35.0

admin@erpls:~/frappe-bench-ERPLS$ 
admin@erpls:~/frappe-bench-ERPLS$ lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal

admin@erpls:~/frappe-bench-ERPLS$ 
admin@erpls:~/frappe-bench-ERPLS$ wkhtmltopdf -V
wkhtmltopdf 0.12.6 (with patched qt)

Hope that helps

( and thanks, btw for the many times you have helped me in recent years @smino, very much appreciated)

[ @rachanna, @Abhiujjwal_Pradhan ]

I’ve this:
erpnextuser001@ERPNEXT-CEWD:~/frappe-bench$ bench --version

5.14.3

erpnextuser001@ERPNEXT-CEWD:~/frappe-bench$ bench version

erpnext 14.1.0

frappe 14.6.0

hrms 0.0.1

payments 0.0.1

erpnextuser001@ERPNEXT-CEWD:~/frappe-bench$ lsb_release -a

No LSB modules are available.

Distributor ID: Debian

Description: Debian GNU/Linux 11 (bullseye)

Release: 11

Codename: bullseye

erpnextuser001@ERPNEXT-CEWD:~/frappe-bench$ wkhtmltopdf -V

wkhtmltopdf 0.12.6

It was my understanding that wkhtmltopdf was replaced in v14. To those of you seeing errors on v14, is the error naming wkhtmltopdf specifically?

Then what’s the solution?

Have you added the host_name in site_config.json ? if not add the below

"host_name": "https://yourdomainname"

Network error is usually when wkhtmltopdf can’t resolve or need the fully resolved URLs to the assets