Skip to content

Bug: Print Designer fails to find Chromium in Docker environments (mismatched config keys) #522

@Jarif-Junaeed

Description

@Jarif-Junaeed

Description

When using Print Designer in a containerized environment (like frappe_docker), PDF generation fails with a ValidationError: Chromium is not downloaded.

This occurs because Print Designer looks for the configuration key chromium_binary_path or a local bench directory, whereas Frappe standardizes on the key chromium_path. Because Print Designer does not find its specific key, it ignores the existing, functional Chromium binary provided by the Docker image at /usr/bin/chromium-headless-shell.

This issue was originally identified and discussed here: frappe/frappe_docker#1821

Steps to Reproduce

  1. Deploy a standard Frappe/ERPNext Docker stack.
  2. Install the print_designer app.
  3. Attempt to generate a PDF using a Print Designer format.
  4. Observe the traceback: frappe.throw("Chromium is not downloaded. Please run the setup first.")

Technical Analysis

In print_designer/pdf_generator/generator.py, the _initialize_chromium method specifically pulls from:

self.CHROMIUM_BINARY_PATH = site_config.get("chromium_binary_path", "")

However, Frappe core and the official Docker images use chromium_path. When chromium_binary_path is empty, the app falls back to _find_chromium_executable(), which strictly checks for a chromium folder within the bench directory. This folder does not (and should not) exist in a managed Docker environment where Chromium is installed system-wide.

Proposed Solution

Print Designer should align with Frappe core standards to ensure out-of-the-box compatibility with Docker.

Suggested Change:
Modify _initialize_chromium to check for chromium_path as a fallback if chromium_binary_path is not set.

# Current implementation
self.CHROMIUM_BINARY_PATH = site_config.get("chromium_binary_path", "")

# Recommended implementation
self.CHROMIUM_BINARY_PATH = site_config.get("chromium_binary_path") or site_config.get("chromium_path", "")

Environment Info

  • Frappe version: 16.10.1
  • ERPNext version: 16.7.0
  • Print Designer version: 1.6.5
  • Deployment: frappe_docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions