Same Issues.
Hi
Really not sure if my comment helps or not.
I had the same issue before and for me the fix was to set “host_name” key to the site host name in site_config.json like https://yoursite… After I did that and redeployed, printdesigner worked again also with the custom templates and also with the printing / pdf download functionality.
Hi, thanks for the suggestion! I’ve tried setting the “host_name” in site_config.json, but it hasn’t resolved the issue on my end. If you’re able to share your Docker Compose file, that would be really helpful to see if there are any differences that might help. Thanks again!
Setting the host_name
to frontend:8080
resolved the issue for that specific configuration, but it caused other links to break, including those in emails and assets.
The traceback you provided indicates that Frappe is trying to attach a file (print_designer-sales_order_pd_v2-preview3f12d3.jpg
) to a document but fails because the file is missing from the expected location:
text
FileNotFoundError: [Errno 2] No such file or directory: './demo.menteware.com/private/files/print_designer-sales_order_pd_v2-preview3f12d3.jpg'
What this means
- The Print Designer is generating a preview image for your print format (
Sales Order PD v2
). - It attempts to save this preview image in the
private/files
folder. - When Frappe tries to insert the
File
document and read the actual file content, the file is missing or not accessible. - This causes the
FileNotFoundError
and the print format preview or save operation fails.
Common causes
- File was deleted or never saved properly
The preview image file was not created or was removed before Frappe could attach it. - Incorrect file path or permissions
The path./demo.menteware.com/private/files/...
might be incorrect or the Frappe process lacks permission to access it. - File storage misconfiguration
If you are using custom file storage or a remote storage backend, the file might not be synced or accessible locally. - Race condition or timing issue
The file was removed or moved before theFile
document was inserted.
How to fix this
1. Verify file existence
- Check if the file exists on your server at the path:
text
./demo.menteware.com/private/files/print_designer-sales_order_pd_v2-preview3f12d3.jpg
- If not, the preview generation failed or the file was deleted.
2. Check file permissions
- Ensure the user running the Frappe/bench process has read access to the
private/files
directory and files.
3. Regenerate the preview
- Try to regenerate the print format preview in Frappe Books or Print Format editor.
- Sometimes, re-saving the print format triggers regeneration of the preview image.
4. Clear cached files
- Sometimes stale or broken file references cause issues.
- You can try clearing the
private/files
directory of orphaned files (backup first). - Or clear the print format preview image field and regenerate.
5. Check file storage settings
- If you use remote storage (S3, etc.), verify that the file is uploaded and accessible.
- For local storage, ensure the
sites/{site_name}/private/files
folder exists and is writable.
6. Review Print Designer app logs
- Check logs for errors during preview image generation.
- Look for errors related to image generation, file saving, or permissions.
Temporary workaround
If you want to bypass this error temporarily:
- Disable preview image generation in the Print Designer settings (if possible).
- Or remove the preview image field value from the Print Format document to avoid attaching a missing file.