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

Site installation error tabLoan doesn't exist #179

Open
1 task done
lvr26 opened this issue May 2, 2024 · 0 comments
Open
1 task done

Site installation error tabLoan doesn't exist #179

lvr26 opened this issue May 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lvr26
Copy link

lvr26 commented May 2, 2024

Information about bug

Command: bench --site <sitename> install-app lending
Getting the app runs smoothly. Installing it to the site returns an error as attached in the below log output section.

Module

Loan Management

Version

Frappe version - 15.21.0
ERPNext version - 15.20.0
hrms version - 16.0.0-dev
lending version - 0.0.1

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

App erpnext already installed

Installing lending...

Running post-install patches to patch existing data...

An error occurred while installing lending: (1146, "Table '_dfe26beb1024fe12.tabLoan' doesn't exist")
Traceback with variables (most recent call last):
  File "apps/frappe/frappe/commands/site.py", line 444, in install_app
    _install_app(app, verbose=context.verbose, force=force)
      context = {'sites': ['gsms.local'], 'force': False, 'verbose': False, 'profile': False}
      apps = ('lending',)
      force = False
      _install_app = <function install_app at 0x7f7c83362f80>
      filelock = <function filelock at 0x7f7c83362c20>
      exit_code = 0
      site = 'gsms.local'
      app = 'lending'
      err = ProgrammingError(1146, "Table '_dfe26beb1024fe12.tabLoan' doesn't exist")
  File "apps/frappe/frappe/installer.py", line 311, in install_app
    frappe.get_attr(after_install)()
      name = 'lending'
      verbose = False
      set_as_patched = True
      force = False
      sync_jobs = <function sync_jobs at 0x7f7c81f68550>
      sync_for = <function sync_for at 0x7f7c81f69000>
      sync_customizations = <function sync_customizations at 0x7f7c834f9bd0>
      sync_fixtures = <function sync_fixtures at 0x7f7c81f69240>
      app_hooks = {'after_install': ['lending.install.after_install'], 'app_description': ['Open Source Lending software'], 'app_email': ['contact@frappe.io'], 'app_include_js': ['lending.bundle.js'], 'app_license': ['GNU General Public License (v3)'], 'app_name': ['lending'], 'app_publisher': ['Frappe Technologies Pvt. Ltd.'], 'app_title': ['Frappe Lending'], 'audit_trail_doctypes': ['Loan Balance Adjustment', 'Loan Disbursement', 'Loan Interest Accrual', 'Loan Refund', 'Loan Repayment', 'Loan Write Off'], 'bank_reconciliation_doctypes': ['Loan Repayment', 'Loan Disbursement'], 'before_tests': ['lending.utils.before_tests'], 'before_uninstall': ['lending.uninstall.before_uninstall'], 'doc_events': {'Company': {'validate': ['lending.overrides.company.validate_loan_tables']}}, 'get_amounts_not_reflected_in_system_for_bank_reconciliation_statement': ['lending.loan_management.utils.get_amounts_not_reflected_in_system_for_bank_reconciliation_statement'], 'get_entries_for_bank_clearance_summary': ['lending.l...
      installed_apps = ['frappe', 'erpnext', 'payments', 'hrms']
      app = 'erpnext'
      required_app = 'erpnext'
      after_install = 'lending.install.after_install'
  File "apps/lending/lending/install.py", line 236, in after_install
    run_patches(get_post_install_patches())
  File "apps/lending/lending/install.py", line 227, in run_patches
    frappe.get_attr(f"lending.patches.v15_0.{patch}.execute")()
      patches = ('rename_loan_type_to_loan_product', 'generate_loan_repayment_schedule', 'update_loan_types', 'make_loan_type_non_submittable', 'migrate_loan_type_to_loan_product', 'add_loan_product_code_and_rename_loan_name', 'update_penalty_interest_method_in_loan_products')
      patch = 'generate_loan_repayment_schedule'
  File "apps/lending/lending/patches/v15_0/generate_loan_repayment_schedule.py", line 8, in execute
    loans_created = frappe.db.count("Loan")
  File "apps/frappe/frappe/database/database.py", line 1138, in count
    count = frappe.qb.get_query(
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7f7c82453760>
      dt = 'Loan'
      filters = None
      debug = False
      cache = False
      distinct = True
  File "apps/frappe/frappe/query_builder/utils.py", line 87, in execute_query
    result = frappe.db.sql(query, params, *args, **kwargs)  # nosemgrep
      query = 'SELECT DISTINCT COUNT(*) FROM `tabLoan`'
      args = ()
      kwargs = {'debug': False}
      child_queries = []
      params = {}
      execute_child_queries = <function patch_query_execute.<locals>.execute_child_queries at 0x7f7c8247b760>
      prepare_query = <function patch_query_execute.<locals>.prepare_query at 0x7f7c8247b7f0>
  File "apps/frappe/frappe/database/database.py", line 234, in sql
    self._cursor.execute(query, values)
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7f7c82453760>
      query = 'SELECT DISTINCT COUNT(*) FROM `tabLoan`'
      values = {}
      as_dict = 0
      as_list = 0
      debug = False
      ignore_ddl = 0
      auto_commit = 0
      update = None
      explain = False
      run = True
      pluck = False
      as_iterator = False
      trace_id = None
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
      self = <pymysql.cursors.Cursor object at 0x7f7c809f3730>
      query = 'SELECT DISTINCT COUNT(*) FROM `tabLoan`'
      args = {}
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
      self = <pymysql.cursors.Cursor object at 0x7f7c809f3730>
      q = 'SELECT DISTINCT COUNT(*) FROM `tabLoan`'
      conn = <pymysql.connections.Connection object at 0x7f7c809f35e0>
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 558, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
      self = <pymysql.connections.Connection object at 0x7f7c809f35e0>
      sql = b'SELECT DISTINCT COUNT(*) FROM `tabLoan`'
      unbuffered = False
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 822, in _read_query_result
    result.read()
      self = <pymysql.connections.Connection object at 0x7f7c809f35e0>
      unbuffered = False
      result = <pymysql.connections.MySQLResult object at 0x7f7c7fa7b790>
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1200, in read
    first_packet = self.connection._read_packet()
      self = <pymysql.connections.MySQLResult object at 0x7f7c7fa7b790>
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 772, in _read_packet
    packet.raise_for_error()
      self = <pymysql.connections.Connection object at 0x7f7c809f35e0>
      packet_type = <class 'pymysql.protocol.MysqlPacket'>
      buff = bytearray(b"\xffz\x04#42S02Table \'_dfe26beb1024fe12.tabLoan\' doesn\'t exist")
      packet_header = b'8\x00\x00\x01'
      btrl = 56
      btrh = 0
      packet_number = 1
      bytes_to_read = 56
      recv_data = b"\xffz\x04#42S02Table '_dfe26beb1024fe12.tabLoan' doesn't exist"
      packet = <pymysql.protocol.MysqlPacket object at 0x7f7c7fa7b7c0>
  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 0x7f7c7fa7b7c0>
      errno = 1146
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
      data = b"\xffz\x04#42S02Table '_dfe26beb1024fe12.tabLoan' doesn't exist"
      errno = 1146
      errval = "Table '_dfe26beb1024fe12.tabLoan' doesn't exist"
      errorclass = <class 'pymysql.err.ProgrammingError'>
pymysql.err.ProgrammingError: (1146, "Table '_dfe26beb1024fe12.tabLoan' doesn't exist")

Code of Conduct

  • I agree to follow this project's Code of Conduct
@lvr26 lvr26 added the bug Something isn't working label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant