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

Unknown table '_cef4968b8549ea81.tabLoan Product' #133

Open
1 task done
jakobkilian opened this issue Nov 19, 2023 · 4 comments
Open
1 task done

Unknown table '_cef4968b8549ea81.tabLoan Product' #133

jakobkilian opened this issue Nov 19, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@jakobkilian
Copy link

Information about bug

Hi, I was trying to install lending to a fresh v14 install of ERPnext and experienced this error. Is "lending" even meant to be installed on 14? Unfortunately also the old Loan Module now doesnt work anymore (I think doctypes are missing).
Is there a way to delete all Loan specific doc types and database entries and install lending fresh?

thanks for your help!

Module

Loan Management

Version

erpnext 14.48.1
frappe 14.55.0
lending 0.0.1

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

Installing lending...
Updating DocTypes for lending       : [========================================] 100%

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

An error occurred while installing lending: (1051, "Unknown table '_cef4968b8549ea81.tabLoan Product'")
Traceback (most recent call last):
  File "apps/frappe/frappe/commands/site.py", line 415, in install_app
    _install_app(app, verbose=context.verbose, force=force)
  File "apps/frappe/frappe/installer.py", line 307, in install_app
    frappe.get_attr(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")()
  File "apps/lending/lending/patches/v15_0/rename_loan_type_to_loan_product.py", line 11, in execute
    frappe.db.sql_ddl("DROP TABLE `tabLoan Product`")
  File "apps/frappe/frappe/database/database.py", line 378, in sql_ddl
    self.sql(query, debug=debug)
  File "apps/frappe/frappe/database/database.py", line 220, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1051, "Unknown table '_cef4968b8549ea81.tabLoan Product'")

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jakobkilian jakobkilian added the bug Something isn't working label Nov 19, 2023
@albertfns
Copy link

I have the same problem using

  • ERPNext: v15.1.0
  • Frappe Framework: v15.1.0
  • Frappe Lending: v0.0.1

@jakobkilian
Copy link
Author

jakobkilian commented Nov 27, 2023

I was fiddling with the broken database entries ( without success, haha) when I realised this:

# The first installation failed (see thread opener). But the apps seems to be installed:
bench --site SITENAME install-app lending
# "App erpnext already installed"
# "App lending already installed"
# so you can do:
bench uninstall-app lending
# which deletes ALL corresponding database entries
# and kinda do a fresh installation with:
bench --site SITENAME install-app lending

Everything works for me now. Of course loan data would be lost I guess.

@bedosk
Copy link

bedosk commented Jan 1, 2024

I had the same problem with V15. My steps to install successfully:
bench --site SITENAME install-app lending
This ends up with the same error as above. Then I run:
bench migrate
and everything works.

@AlaaBadry
Copy link

image

i have the same issue and have this error when try to create loan repayment

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

4 participants