frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.74k stars 7.3k forks source link

/integrations/gocardless_checkout failed on v14 #33919

Closed vcavel closed 1 year ago

vcavel commented 1 year ago

Information about bug

Hi, my customers can no longer access the gocardless interface to subcribe after the v14 update, here is the stacktrace that happens when they click on the {{payment_url}} in the payment request.

Cheers

Module

selling

Version

ERPNext: v14.15.0 (version-14) Frappe Framework: v14.25.0 (version-14) Payments: v0.0.1 (develop)

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

Traceback with variables (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 18, in get_response
    response = renderer_instance.render()
      path = '/integrations/gocardless_checkout'
      http_status_code = 200
      response = None
      endpoint = 'integrations/gocardless_checkout'
      path_resolver = <frappe.website.path_resolver.PathResolver object at 0x7fd6a590d5d0>
      renderer_instance = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fd6a5a90af0>
      e = OperationalError(1054, "Unknown column 'header_img' in 'field list'")
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 78, in render
    html = self.get_html()
      self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fd6a5a90af0>
  File "apps/frappe/frappe/website/utils.py", line 510, in cache_html_decorator
    html = func(*args, **kwargs)
      args = (<frappe.website.page_renderers.template_page.TemplatePage object at 0x7fd6a5a90af0>,)
      kwargs = {}
      html = None
      page_cache = None
      func = <function TemplatePage.get_html at 0x7fd6a54d1120>
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 89, in get_html
    self.update_context()
      self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fd6a5a90af0>
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 157, in update_context
    data = self.run_pymodule_method("get_context")
      self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fd6a5a90af0>
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 219, in run_pymodule_method
    return method(self.context)
      self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7fd6a5a90af0>
      method_name = 'get_context'
      inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
      method = <function get_context at 0x7fd6a4099ab0>
  File "apps/erpnext/erpnext/templates/pages/integrations/gocardless_checkout.py", line 41, in get_context
    context["header_img"] = frappe.db.get_value(
      context = {'top_bar_items': [], 'footer_items': [], 'post_login': [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}], 'brand_html': "<img src='/files/Logo_LSS_2016-013cdc37.png' style='max-width: 40px; max-height: 25px;'> Le Singe Savant", 'navbar_template': 'Standard Navbar', 'footer_template': 'Standard Footer', 'facebook_share': 0, 'google_plus_one': 0, 'twitter_share': 0, 'linked_in_share': 0, 'disable_signup': 0, 'url': 'https://erp.singe-savant.com', 'encoded_title': '', 'web_include_js': ['website_script.js', 'erpnext-web.bundle.js'], 'web_include_css': ['erpnext-web.bundle.css'], 'favicon': '/assets/erpnext/images/erpnext-favicon.svg', 'splash_image': '/assets/erpnext/images/erpnext-logo.svg', 'theme': <WebsiteTheme: Standard>, 'hide_login': 0, 'read_only_mode': False, 'boot': {'sysdefaults': {'float_precision': 3, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm'}, 'time_zone': {'system': 'Europe/Paris', 'user': 'Europe/Paris'}}, 'base_template': ...
      key = <exception while printing> Traceback (most recent call last):
          File "env/lib/python3.10/site-packages/traceback_with_variables/core.py", line 222, in _to_cropped_str
            raw = print_(obj)
        TypeError: _get_sanitizer.<locals>.<listcomp>.<lambda>() takes 0 positional arguments but 1 was given

      gateway_controller = 'Prelevement SEPA'
  File "apps/frappe/frappe/database/database.py", line 495, in get_value
    result = self.get_values(
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7fd6a5af1e10>
      doctype = 'GoCardless Settings'
      filters = 'Prelevement SEPA'
      fieldname = 'header_img'
      ignore = None
      as_dict = False
      debug = False
      order_by = 'KEEP_DEFAULT_ORDERING'
      cache = False
      for_update = False
      run = True
      pluck = False
      distinct = False
  File "apps/frappe/frappe/database/database.py", line 592, in get_values
    out = self._get_values_from_table(
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7fd6a5af1e10>
      doctype = 'GoCardless Settings'
      filters = 'Prelevement SEPA'
      fieldname = 'header_img'
      ignore = None
      as_dict = False
      debug = False
      order_by = 'modified'
      update = None
      cache = False
      for_update = False
      run = True
      pluck = False
      distinct = False
      limit = 1
      out = None
      fields = ['header_img']
  File "apps/frappe/frappe/database/database.py", line 822, in _get_values_from_table
    return self.sql(query, as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7fd6a5af1e10>
      fields = ['header_img']
      filters = 'Prelevement SEPA'
      doctype = 'GoCardless Settings'
      as_dict = False
      debug = False
      order_by = 'modified'
      update = None
      for_update = False
      run = True
      pluck = False
      distinct = False
      limit = 1
      field_objects = []
      query = SELECT `header_img` FROM `tabGoCardless Settings` WHERE `name`='Prelevement SEPA' ORDER BY `modified` DESC LIMIT 1
  File "apps/frappe/frappe/database/database.py", line 218, in sql
    self._cursor.execute(query, values)
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7fd6a5af1e10>
      query = "SELECT `header_img` FROM `tabGoCardless Settings` WHERE `name`='Prelevement SEPA' ORDER BY `modified` DESC LIMIT 1"
      values = None
      as_dict = False
      as_list = 0
      formatted = 0
      debug = False
      ignore_ddl = 0
      as_utf8 = 0
      auto_commit = 0
      update = None
      explain = False
      run = True
      pluck = False
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
      self = <pymysql.cursors.Cursor object at 0x7fd6a590d060>
      query = "SELECT `header_img` FROM `tabGoCardless Settings` WHERE `name`='Prelevement SEPA' ORDER BY `modified` DESC LIMIT 1"
      args = None
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
      self = <pymysql.cursors.Cursor object at 0x7fd6a590d060>
      q = "SELECT `header_img` FROM `tabGoCardless Settings` WHERE `name`='Prelevement SEPA' ORDER BY `modified` DESC LIMIT 1"
      conn = <pymysql.connections.Connection object at 0x7fd6a590d570>
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
      self = <pymysql.connections.Connection object at 0x7fd6a590d570>
      sql = b"SELECT `header_img` FROM `tabGoCardless Settings` WHERE `name`='Prelevement SEPA' ORDER BY `modified` DESC LIMIT 1"
      unbuffered = False
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
      self = <pymysql.connections.Connection object at 0x7fd6a590d570>
      unbuffered = False
      result = <pymysql.connections.MySQLResult object at 0x7fd6a5a908e0>
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
      self = <pymysql.connections.MySQLResult object at 0x7fd6a5a908e0>
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
      self = <pymysql.connections.Connection object at 0x7fd6a590d570>
      packet_type = <class 'pymysql.protocol.MysqlPacket'>
      buff = bytearray(b"\xff\x1e\x04#42S22Unknown column \'header_img\' in \'field list\'")
      packet_header = b'4\x00\x00\x01'
      btrl = 52
      btrh = 0
      packet_number = 1
      bytes_to_read = 52
      recv_data = b"\xff\x1e\x04#42S22Unknown column 'header_img' in 'field list'"
      packet = <pymysql.protocol.MysqlPacket object at 0x7fd6a5a64250>
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
      self = <pymysql.protocol.MysqlPacket object at 0x7fd6a5a64250>
      errno = 1054
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
      data = b"\xff\x1e\x04#42S22Unknown column 'header_img' in 'field list'"
      errno = 1054
      errval = "Unknown column 'header_img' in 'field list'"
      errorclass = <class 'pymysql.err.OperationalError'>
pymysql.err.OperationalError: (1054, "Unknown column 'header_img' in 'field list'")
vcavel commented 1 year ago

Hi @deepeshgarg007 , why did you close it ?