Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Generate or Preview Invoices - Page Stuck in Loading Stat #384

Open
Venkateshvenki404224 opened this issue Dec 27, 2024 · 1 comment

Comments

@Venkateshvenki404224
Copy link

Venkateshvenki404224 commented Dec 27, 2024

I am facing an issue while generating and previewing invoices in Frappe. Whenever I try to generate an invoice that is designed using print designer or access the preview, the page enters a loading state and eventually shows an error. However, the error logs do not display any related information, making it difficult to debug the issue.

Sna.mp4

image_2024-12-27_11-32-00

image

I am using Print Designer Version:

print_designer 1.2.0
UnexpectedResponseException {message: 'Unexpected server response (504) while retrieving …A-FEE-06047&format=Student+Tax+Invoice&_lang=en".', name: 'UnexpectedResponseException', status: 504, stack: 'Error\n    at BaseExceptionClosure (<anonymous>:22:…/frappe/dist/js/desk.bundle.E7M7U3SJ.js:274:2456)'}
message
: 
"Unexpected server response (504) while retrieving PDF \"https://portal.selfmade.ninja/api/method/frappe.utils.print_format.download_pdf?doctype=Fees&name=SNA-FEE-06047&format=Student+Tax+Invoice&_lang=en\"."
name
: 
"UnexpectedResponseException"
status
: 
504
stack
: 
"Error\n    at BaseExceptionClosure (<anonymous>:22:9061)\n    at Array.<anonymous> (<anonymous>:22:9132)\n    at __w_pdfjs_require__ (<anonymous>:22:363969)\n    at <anonymous>:22:368173\n    at <anonymous>:22:368440\n    at <anonymous>:22:368471\n    at webpackUniversalModuleDefinition (<anonymous>:22:290)\n    at <anonymous>:22:294\n    at Object.eval (https://portal.selfmade.ninja/assets/frappe/dist/js/desk.bundle.E7M7U3SJ.js:294:1433)\n    at Object.js (https://portal.selfmade.ninja/assets/frappe/dist/js/desk.bundle.E7M7U3SJ.js:274:2456)"
[[Prototype]]
: 
Error
constructor
: 
class UnexpectedResponseException
stack
: 
"Error\n    at BaseExceptionClosure (<anonymous>:22:9061)\n    at Array.<anonymous> (<anonymous>:22:9132)\n    at __w_pdfjs_require__ (<anonymous>:22:363969)\n    at <anonymous>:22:368173\n    at <anonymous>:22:368440\n    at <anonymous>:22:368471\n    at webpackUniversalModuleDefinition (<anonymous>:22:290)\n    at <anonymous>:22:294\n    at Object.eval (https://portal.selfmade.ninja/assets/frappe/dist/js/desk.bundle.E7M7U3SJ.js:294:1433)\n    at Object.js (https://portal.selfmade.ninja/assets/frappe/dist/js/desk.bundle.E7M7U3SJ.js:274:2456)"
[[Prototype]]
: 
Error at BaseExceptionClosure (<anonymous>:22:9061) at Array.<anonymous> (<anonymous>:22:9132) at __w_pdfjs_require__ (<anonymous>:22:363969) at <anonymous>:22:368173 at <anonymous>:22:368440 at <anonymous>:22:368471 at webpackUniversalModuleDefinition (<anonymous>:22:290) at <anonymous>:22:294 at Object.eval (https://portal.selfmade.ninja/assets/frappe/dist/js/desk.bundle.E7M7U3SJ.js:294:1433) at Object.js (https://portal.selfmade.ninja/assets/frappe/dist/js/desk.bundle.E7M7U3SJ.js:274:2456)

The api request for generating the pdf is getting failed :

I would appreciate any guidance on how to troubleshoot or resolve this issue. Is there a way to enable more detailed logging to capture what’s going wrong? Or are there known issues or fixes for this behavior in the current version?

Thank you for your support!

@RaySolo
Copy link

RaySolo commented Dec 28, 2024

I get the same error message. The LOG says that I cannot access the .jpg because it does not exist. but that is not true. the file exists, the user and access rights are also correct.

Traceback with variables (most recent call last):
File "apps/frappe/frappe/core/doctype/file/utils.py", line 372, in attach_files_to_document
file.insert(ignore_permissions=True)
doc = <PDPrintFormat: PD SalesOrder V143.1>
event = 'on_update'
attach_fields = []
df =
value = '/private/files/print_designer-pd_salesorder_v143.1-preview.jpg'
unattached_file = None
file = <File: unsaved>
File "apps/frappe/frappe/model/document.py", line 289, in insert
self.run_method("before_insert")
self = <File: unsaved>
ignore_permissions = True
ignore_links = None
ignore_if_duplicate = False
ignore_mandatory = None
set_name = None
set_child_names = True
File "apps/frappe/frappe/model/document.py", line 974, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
self = <File: unsaved>
method = 'before_insert'
args = ()
kwargs = {}
fn = <function Document.run_method..fn at 0x79fbf6359d00>
File "apps/frappe/frappe/model/document.py", line 1334, in composer
return composed(self, method, args, **kwargs)
self = <File: unsaved>
args = ()
kwargs = {}
hooks = []
method = 'before_insert'
doc_events = {'
': {'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply'], 'on_trash': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions'], 'on_update_after_submit': ['frappe.workflow.doctype.workflow_action.workflow_action.process_w...
composed = <function Document.hook..compose..runner at 0x79fbf6359940>
compose = <function Document.hook..compose at 0x79fbf6358f40>
f = <function Document.run_method..fn at 0x79fbf6359d00>
File "apps/frappe/frappe/model/document.py", line 1316, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
self = <File: unsaved>
method = 'before_insert'
args = ()
kwargs = {}
add_to_return_value = <function Document.hook..add_to_return_value at 0x79fbf6359da0>
fn = <function Document.run_method..fn at 0x79fbf6359d00>
hooks = ()
File "apps/frappe/frappe/model/document.py", line 971, in fn
return method_object(*args, **kwargs)
self = <File: unsaved>
args = ()
kwargs = {}
method_object = <bound method File.before_insert of <File: unsaved>>
method = 'before_insert'
File "apps/frappe/frappe/core/doctype/file/file.py", line 104, in before_insert
self.save_file(content=self.get_content())
self = <File: unsaved>
File "apps/frappe/frappe/core/doctype/file/file.py", line 539, in get_content
with open(file_path, mode="rb") as f:
self = <File: unsaved>
file_path = './erpdev.lan/private/files/print_designer-pd_salesorder_v143.1-preview.jpg'
builtins.FileNotFoundError: [Errno 2] No such file or directory: './erpdev.lan/private/files/print_designer-pd_salesorder_v143.1-preview.jpg'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants