Automatic Emails Fail due to PDF generation - but PDFs work!

ERPNext: v14.21.0 (version-14)
Frappe Framework: v14.32.1 (version-14)

I have a problem with emailing reports (e.g. invoices) automatically. However if I go to Email Queue and then manually press Send Now, the email is sent.

The error log complains:-
frappe.exceptions.ValidationError: PDF generation failed because of broken image links

The only image in the pdf is the company header, and I have been trying to replace it, change it to HTML header etc. but does not fix the issue.

I can generate PDFs from e.g. Sales Invoice page and I can also send the email manually as described above.

This problem arose since I upgraded from ERPNext V13 to V14. The way I upgraded was

  1. Installed new clean install of ERPNext V14
  2. Restored V13 database. The system threw couple of errors but seems to have resolved the issues.

Any ideas? Thank you.

Actually created new header file, and still no luck. I am not actually sure if the issue is image embedding as the error message does not mention any image file name. Maybe it is something to do with Frappe framework embedding images through a tmp file.

options = {‘print-media-type’: None, ‘background’: None, ‘images’: None, ‘quiet’: None, ‘encoding’: ‘UTF-8’, ‘margin-right’: ‘15mm’, ‘margin-left’: ‘15mm’, ‘header-html’: ‘/tmp/frappe-pdf-8dd1c38c7187dccce2667bafed8d0b29bf48a06f20b007faa27d7159.html’, ‘footer-html’: ‘/tmp/frappe-pdf-a6d445e4389d7c35cb3465293f1fda1c9c2e97d1bce55cca39be3f13.html’, ‘page-size’: ‘A4’, ‘disable-javascript’: ‘’, ‘disable-local-file-access’: ‘’, ‘disable-smart-shrinking’: ‘’}
output = None
filedata = ‘’
File “apps/frappe/frappe/init.py”, line 525, in throw
msgprint(
msg = ‘PDF generation failed because of broken image links’
exc = <class ‘frappe.exceptions.ValidationError’>