This error happened to me while I was do some customization , I spend when I received notification of new version of bench , as usual:
bench update --no-backup
but the problem was I could not reach any sites associated with that bench. When I browse the url of my local site I get this message:
pymysql.err.OperationalError: (1054, “Unknown column ‘date_format’ in ‘field list’”)
with the following tracback of the error filling the browser page :
File "/bench-0/env/lib/python3.12/site-packages/pymysql/protocol.py", line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File "/bench-0/env/lib/python3.12/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'date_format' in 'field list'")
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/bench-0/apps/frappe/frappe/app.py", line 127, in application
response = get_response()
^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/website/serve.py", line 28, in get_response
response = ErrorPage(exception=e).render()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/website/utils.py", line 530, in cache_html_decorator
html = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/website/page_renderers/template_page.py", line 92, in get_html
self.init_context()
File "/bench-0/apps/frappe/frappe/website/page_renderers/error_page.py", line 14, in init_context
super().init_context()
File "/bench-0/apps/frappe/frappe/website/page_renderers/base_template_page.py", line 15, in init_context
self.context.update(get_website_settings())
^^^^^^^^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/website/doctype/website_settings/website_settings.py", line 263, in get_website_settings
context.boot = get_boot_data()
^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/website/utils.py", line 178, in get_boot_data
"date_format": get_date_format(),
^^^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/locale.py", line 21, in get_date_format
return get_locale_value("date_format", language) or "yyyy-mm-dd"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/locale.py", line 50, in get_locale_value
value = frappe.db.get_value("Language", lang, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/database/database.py", line 523, in get_value
result = self.get_values(
^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/database/database.py", line 627, in get_values
out = self._get_values_from_table(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/database/database.py", line 900, in _get_values_from_table
return query.run(as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/bench-0/apps/frappe/frappe/query_builder/utils.py", line 84, in execute_query
result = frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
How to solve it ?