Error generating pdf quotation erpnext v16.1.0

hi when generating pdf i got error http:/myip:8080/api/method/frappe.utils.print_format.download_pdf?doctype=Quotation&name=SAL-QTN-2026-00001&format=Cotizacion&no_letterhead=1&letterhead=Sin%20Membrete&settings={}&_lang=en&pdf_generator=chrome

Server Error 500: Uncaught Exception

Server Error
500: Uncaught Exception

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 121, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 63, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 40, in handle_rpc_call
    return frappe.handler.handle()
           ~~~~~~~~~~~~~~~~~~~~~^^
  File "apps/frappe/frappe/handler.py", line 53, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1124, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 36, in wrapper
    return func(*args, **kwargs)
  File "apps/frappe/frappe/utils/print_format.py", line 239, in download_pdf
    pdf_file = frappe.get_print(
    	doctype,
    ...<6 lines>...
    	pdf_generator=pdf_generator,
    )
  File "apps/frappe/frappe/utils/print_utils.py", line 88, in get_print
    pdf = frappe.call(
    	hook,
    ...<4 lines>...
    	pdf_generator=local.form_dict.pdf_generator,
    )
  File "apps/frappe/frappe/__init__.py", line 1124, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/pdf.py", line 140, in wrapper
    result = func(*args, **kwargs)
  File "apps/frappe/frappe/utils/pdf.py", line 160, in get_chrome_pdf
    browser = Browser(generator, print_format, html, options)
  File "apps/frappe/frappe/utils/pdf_generator/browser.py", line 20, in __init__
    self.open(generator)
    ~~~~~~~~~^^^^^^^^^^^
  File "apps/frappe/frappe/utils/pdf_generator/browser.py", line 60, in open
    generator._set_devtools_url()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "apps/frappe/frappe/utils/pdf_generator/chrome_pdf_generator.py", line 218, in _set_devtools_url
    raise TimeoutError("Chromium took too long to start.")
TimeoutError: Chromium took too long to start.

is this problem already solved? encounter the same error too, looking for guidelines, thanks.

Not sure if this is your exact problem but we use frappe docker and this did the trick for us:

Fixed execute permissions on Chromium binary:

chmod +x /workspace/development/frappe-bench/chromium/chrome-linux/headless_shell

Installed missing shared libraries for Chromium:

sudo apt-get update && sudo apt-get install -y libatk1.0-0 libatspi2.0-0 libxcomposite1 libxdamage1

Restarted the bench server to pick up the changes.

1 Like

Thank you for this.