frappe / frappe

Low code web framework for real world applications, in Python and Javascript
https://frappeframework.com
MIT License
7.25k stars 3.44k forks source link

SessionBootFailed: changelog feed error. #26724

Closed arsanysamuel closed 5 months ago

arsanysamuel commented 5 months ago

Description of the issue

I've deployed Frappe/ERPNext alongside a custom app on a server and after working fine for some time the desk is inaccesible due to an Uncaught Server Exception with error code 500

Context information (for bug reports)

There were no changes whatsoever to the current setup and deployment

Output of bench version

erpnext 15.26.1
frappe 15.29.0
custom_app 0.0.1
sentry 0.1.0

Steps to reproduce the issue

  1. Deploy Frappe/ERPNext with the versions above
  2. Wait for serveral days/weeks

Observed result

Can't access the app website or desk

Expected result

Access to the desk with the changelog of the new versions

Stacktrace / full error message

Traceback (most recent call last):
  File "apps/frappe/frappe/www/app.py", line 27, in get_context
    boot = frappe.sessions.get()
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/sessions.py", line 139, in get
    bootinfo = get_bootinfo()
               ^^^^^^^^^^^^^^
  File "apps/frappe/frappe/boot.py", line 114, in get_bootinfo
    bootinfo.changelog_feed = get_changelog_feed_items()
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/caching.py", line 156, in redis_cache_wrapper
    val = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/doctype/changelog_feed/changelog_feed.py", line 68, in get_changelog_feed_items
    feed = frappe.get_all(
           ^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 2057, in get_all
    return get_list(doctype, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 2032, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/db_query.py", line 185, in execute
    self.columns = self.get_table_columns()
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/db_query.py", line 546, in get_table_columns
    return get_table_columns(self.doctype)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/meta.py", line 73, in get_table_columns
    return frappe.db.get_table_columns(doctype)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/database.py", line 1197, in get_table_columns
    raise self.TableMissingError("DocType", doctype)
pymysql.err.ProgrammingError: ('DocType', 'Changelog Feed')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 20, in get_response
    response = renderer_instance.render()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
    html = self.get_html()
           ^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/utils.py", line 523, in cache_html_decorator
    html = func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
    self.update_context()
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 163, in update_context
    data = self.run_pymodule_method("get_context")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/website/page_renderers/template_page.py", line 223, in run_pymodule_method
    return method(self.context)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/www/app.py", line 29, in get_context
    raise frappe.SessionBootFailed from e
frappe.exceptions.SessionBootFailed

Additional information

Deployed on GCP using frappe/helm

ankush commented 5 months ago

You mostly updated without migrating, so the new table doesn't exist.

Just run bench migrate once.