We have recently migrated our ERPnext 13 environment to a fresh server running ubuntu with erpnext 14. before restoring the database, all pages operate without any issues. After performing bench restore, bench migrate and bench install-app hrms, the designation page stops to operate, although the doctype still exists and the data is there. after checking the error log, i can see the following error:
Traceback with variables (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 18, in get_response
response = renderer_instance.render()
path = '_test/problematic_page'
http_status_code = 200
response = None
endpoint = '_test/problematic_page'
path_resolver = <frappe.website.path_resolver.PathResolver object at 0x7f0b1b879660>
renderer_instance = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7f0b1b864d60>
e = ValidationError('{% raise %}\nTraceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n')
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 78, in render
html = self.get_html()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7f0b1b864d60>
File "apps/frappe/frappe/website/utils.py", line 510, in cache_html_decorator
html = func(*args, **kwargs)
args = (<frappe.website.page_renderers.template_page.TemplatePage object at 0x7f0b1b864d60>,)
kwargs = {}
func = <function TemplatePage.get_html at 0x7f0b1ef1b1c0>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
html = self.render_template()
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7f0b1b864d60>
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 232, in render_template
html = frappe.render_template(self.source, self.context, safe_render=safe_render)
self = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7f0b1b864d60>
safe_render = True
File "apps/frappe/frappe/utils/jinja.py", line 87, in render_template
throw(
template = '{% raise %}\n'
context = {'top_bar_items': [<TopBarItem: eb4c4a75d8 parent=Website Settings>, <TopBarItem: e7dc3257b9 parent=Website Settings>, <TopBarItem: 74feb5e289 parent=Website Settings>], 'footer_items': [], 'post_login': [{'label': 'My Account', 'url': '/me'}, {'label': 'Log out', 'url': '/?cmd=web_logout'}], 'brand_html': 'Digital Myth Solutions', 'copyright': 'Digital Myth Solutions', 'facebook_share': 0, 'google_plus_one': 0, 'twitter_share': 0, 'linked_in_share': 0, 'disable_signup': 0, 'url': 'http://localhost', 'encoded_title': '', 'web_include_js': ['website_script.js', 'erpnext-web.bundle.js'], 'web_include_css': ['erpnext-web.bundle.css'], 'favicon': '/assets/erpnext/images/erpnext-favicon.svg', 'splash_image': '/assets/erpnext/images/erpnext-logo.svg', 'theme': <WebsiteTheme: DMS Theme>, 'hide_login': 0, 'read_only_mode': False, 'boot': {'sysdefaults': {'float_precision': 2, 'date_format': 'dd-mm-yyyy', 'time_format': 'HH:mm:ss'}, 'time_zone': {'system': 'Asia/Riyadh', 'user': 'Asia/Riyadh'}}...
is_path = None
safe_render = True
TemplateError = <class 'jinja2.exceptions.TemplateError'>
_ = <function _ at 0x7f0b22a38280>
get_traceback = <function get_traceback at 0x7f0b21cbbd00>
throw = <function throw at 0x7f0b21cdc280>
File "apps/frappe/frappe/__init__.py", line 525, in throw
msgprint(
msg = '<pre>{% raise %}\n</pre><pre>Traceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "<unknown>", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n</pre>'
exc = <class 'frappe.exceptions.ValidationError'>
title = 'Jinja Template Error'
is_minimizable = False
wide = False
as_list = False
File "apps/frappe/frappe/__init__.py", line 493, in msgprint
_raise_exception()
title = 'Jinja Template Error'
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
sys = <module 'sys' (built-in)>
out = {'message': '<pre>{% raise %}\n</pre><pre>Traceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "<unknown>", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n</pre>', 'title': 'Jinja Template Error', 'indicator': 'red', 'raise_exception': 1}
_raise_exception = <function msgprint.<locals>._raise_exception at 0x7f0b1bfe05e0>
_strip_html_tags = <functools._lru_cache_wrapper object at 0x7f0b1bdbc3b0>
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = '{% raise %}\nTraceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n'
raise_exception = <class 'frappe.exceptions.ValidationError'>
strip_html_tags = <function strip_html_tags at 0x7f0b21ca2ef0>
File "apps/frappe/frappe/__init__.py", line 442, in _raise_exception
raise raise_exception(msg)
inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'>
msg = '{% raise %}\nTraceback (most recent call last):\n File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template\n return get_jenv().from_string(template).render(context)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string\n return cls.from_code(self, self.compile(source), gs, None)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile\n self.handle_exception(source=source_hint)\n File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception\n raise rewrite_traceback_stack(source=source)\n File "", line 1, in template\njinja2.exceptions.TemplateSyntaxError: Encountered unknown tag \'raise\'.\n'
raise_exception = <class 'frappe.exceptions.ValidationError'>
frappe.exceptions.ValidationError: {% raise %}
Traceback (most recent call last):
File "apps/frappe/frappe/utils/jinja.py", line 85, in render_template
return get_jenv().from_string(template).render(context)
File "env/lib/python3.10/site-packages/jinja2/environment.py", line 1105, in from_string
return cls.from_code(self, self.compile(source), gs, None)
File "env/lib/python3.10/site-packages/jinja2/environment.py", line 768, in compile
self.handle_exception(source=source_hint)
File "env/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "", line 1, in template
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'raise'.
as a quick update, i tried bench reload-doctype with no success, and running bench update, bench migrate multiple times didnt work