alyf-de / banking

An Open Banking Integration with ERPNext
GNU General Public License v3.0
37 stars 18 forks source link

Error after installation: ModuleNotFoundError: No module named 'banking' #86

Closed jakobkilian closed 8 months ago

jakobkilian commented 8 months ago

Hi! I set up a self hosted ERPnext 15 installation on a Hetzner ARM VPS to learn and test the system. Installation of "banking" went through without errors. Now when accessing the ERPnext app in the browser, this error gets thrown...

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/serve.py", line 17, in get_response
    endpoint, renderer_instance = path_resolver.resolve()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/path_resolver.py", line 37, in resolve
    resolve_redirect(self.path, request.query_string)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/path_resolver.py", line 108, in resolve_redirect
    redirects += frappe.get_all("Website Route Redirect", ["source", "target"], order_by=None)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1974, in get_all
    return get_list(doctype, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1949, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py", line 179, in execute
    if is_virtual_doctype(self.doctype):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/caching.py", line 123, in site_cache_wrapper
    return func(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/utils/__init__.py", line 133, in is_virtual_doctype
    if frappe.db.has_column("DocType", "is_virtual"):
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/werkzeug/local.py", line 311, in __get__
    obj = instance._get_current_object()
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/werkzeug/local.py", line 490, in _get_current_object
    raise RuntimeError(unbound_message) from None
RuntimeError: object is not bound

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/middlewares.py", line 16, in __call__
    return super().__call__(environ, start_response)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/werkzeug/middleware/shared_data.py", line 249, in __call__
    return self.app(environ, start_response)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/werkzeug/middleware/shared_data.py", line 249, in __call__
    return self.app(environ, start_response)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 74, in application
    app(environ, start_response),
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/werkzeug/wrappers/request.py", line 189, in application
    resp = f(*args[:-2] + (request,))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 128, in application
    response = handle_exception(e)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 389, in handle_exception
    response = get_response("message", http_status_code=http_status_code)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/serve.py", line 26, in get_response
    response = ErrorPage(exception=e).render()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/page_renderers/error_page.py", line 7, in __init__
    super().__init__(path=path, http_status_code=http_status_code)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/page_renderers/template_page.py", line 45, in __init__
    self.set_template_path()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/page_renderers/template_page.py", line 54, in set_template_path
    app_path = frappe.get_app_path(app)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1438, in get_app_path
    return get_pymodule_path(app_name, *joins)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1468, in get_pymodule_path
    return abspath(join(dirname(get_module(scrub(modulename)).__file__ or ""), *joins))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1409, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'banking'

I tried to run the installation a second time by doing

bench --site SITENAME remove-from-installed-apps banking    #results in error 500
bench --site SITENAME uninstall-app banking  #returns "App banking not installed on Site SITENAME" but it's working again
# install would now fail because of "IntegrityError(1062, "Duplicate entry 'Klarna Kosma Integration' for key 'PRIMARY'")"
# so go to mariadb and delete this entry:
bench --site SITENAME mariadb
DELETE FROM `tabModule Def` WHERE name='Klarna Kosma Integration';
bench --site SITENAME install-app banking 
# same issue...

Also tried without success:

bench setup requirements
bench build
bench restart

thanks for helping!

barredterra commented 8 months ago

Hi @jakobkilian, thanks for trying our app. However, the error is likely due to your installation procedure and unrelated to the banking app. By the way, we don't officially support version-15 as of today.

barredterra commented 8 months ago

I just tried these commands and didn't encounter any errors:

nvm use 18
bench init --python python3.11 --no-backups --frappe-branch version-15-hotfix version-15
cd version-15
bench get-app https://github.com/alyf-de/banking.git
bench get-app erpnext --branch version-15-hotfix
bench new-site erpnext-15.localhost --install-app erpnext
bench use erpnext-15.localhost
bench install-app banking
bench start
jakobkilian commented 8 months ago

thx for the quick help and the test. I will try to dig deeper ;-)

jakobkilian commented 8 months ago

worked with a fresh install