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

prepared report fails #66

Open
ashish-greycube opened this issue Mar 20, 2024 · 7 comments
Open

prepared report fails #66

ashish-greycube opened this issue Mar 20, 2024 · 7 comments

Comments

@ashish-greycube
Copy link

Expected behaviour

Prepared reports should work

Actual behaviour

raceback with variables (most recent call last):
  File "apps/frappe/frappe/desk/query_report.py", line 293, in get_prepared_report_result
    if data := json.loads(doc.get_prepared_data().decode("utf-8")):
      report = <Report: General Ledger>
      filters = {'company': 'Tech India Engineers Pvt. Limited', 'from_date': '2023-04-01', 'to_date': '2024-03-20', 'account': [], 'party': [], 'group_by': 'Group by Voucher (Consolidated)', 'cost_center': [], 'project': [], 'include_dimensions': 1, 'include_default_book_entries': 1}
      dn = '70e883c13d'
      user = '[email protected]'
      get_completed_prepared_report = <function get_completed_prepared_report at 0x7f09f4021630>
      get_report_data = <function get_prepared_report_result.<locals>.get_report_data at 0x7f09f2bb40d0>
      report_data = {}
      doc = <PreparedReport: 70e883c13d>
  File "apps/frappe/frappe/core/doctype/prepared_report/prepared_report.py", line 56, in get_prepared_data
    return gzip_decompress(attached_file.get_content())
      self = <PreparedReport: 70e883c13d>
      with_file_name = False
      attachments = [{'name': 'fa79dbf06d', 'file_name': '2024-59-20-9:3.json.gz', 'file_url': '/api/method/frappe_s3_attachment.controller.generate_file?key=erpnext/2024/03/20/Prepared Report/M2ZMY0IU_2024-59-20-93.json.gz&file_name=2024-59-20-9:3.json.gz', 'is_private': 1}]
      attachment = {'name': 'fa79dbf06d', 'file_name': '2024-59-20-9:3.json.gz', 'file_url': '/api/method/frappe_s3_attachment.controller.generate_file?key=erpnext/2024/03/20/Prepared Report/M2ZMY0IU_2024-59-20-93.json.gz&file_name=2024-59-20-9:3.json.gz', 'is_private': 1}
      attached_file = <File: fa79dbf06d>
  File "apps/frappe/frappe/core/doctype/file/file.py", line 472, in get_content
    self.validate_file_url()
      self = <File: fa79dbf06d>
  File "apps/frappe/frappe/core/doctype/file/file.py", line 177, in validate_file_url
    frappe.throw(
      self = <File: fa79dbf06d>
  File "apps/frappe/frappe/__init__.py", line 534, in throw
    msgprint(
      msg = 'URL must start with http:// or https://'
      exc = <class 'frappe.exceptions.ValidationError'>
      title = 'Invalid URL'
      is_minimizable = False
      wide = False
      as_list = False
  File "apps/frappe/frappe/__init__.py", line 502, in msgprint
    _raise_exception()
      title = 'Invalid URL'
      as_table = False
      as_list = False
      indicator = 'red'
      alert = False
      primary_action = None
      is_minimizable = False
      wide = False
      sys = <module 'sys' (built-in)>
      out = {'message': 'URL must start with http:// or https://', 'title': 'Invalid URL', 'indicator': 'red', 'raise_exception': 1}
      _raise_exception = <function msgprint.<locals>._raise_exception at 0x7f09f2bb5fc0>
      _strip_html_tags = <functools._lru_cache_wrapper object at 0x7f09f20decf0>
      inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
      msg = 'URL must start with http:// or https://'
      raise_exception = <class 'frappe.exceptions.ValidationError'>
      strip_html_tags = <function strip_html_tags at 0x7f09f70945e0>
  File "apps/frappe/frappe/__init__.py", line 451, in _raise_exception
    raise raise_exception(msg)
      inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
      msg = 'URL must start with http:// or https://'
      raise_exception = <class 'frappe.exceptions.ValidationError'>
frappe.exceptions.ValidationError: URL must start with http:// or https://

Step to reproduce

Go to general ledger report in v14 . it is a prepared report and it fails

Version

v14

@ashish-greycube
Copy link
Author

@shridarpatil , this is bit urgent. Note we have purchased support for the app. But not sure where to raise or submit support ticket for above issue. Thanks

@ashish-greycube
Copy link
Author

@shridarpatil
Copy link
Member

This error is on which action can you give some more details?

@ashish-greycube
Copy link
Author

open any prepared report
image
Peek 2024-03-20 11-36

@ashish-greycube
Copy link
Author

@shridarpatil , let me know if any other info is required. thanks

@shridarpatil
Copy link
Member

shridarpatil commented Mar 20, 2024

if it's urgent you can add "ignore_s3_upload_for_doctype": ["Prepared Report"] for now so that it will ignore s3 upload

@anushreelimaaye
Copy link

Not able to generate Stock Balance report. Any solution for this?

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

3 participants