[Bug] TemplateNotFound

We are experiencing issues right now, with all of us who are on latest bench, frappe, erpnext having the problem that template files are not loading correctly. This means that for example Sales Order is not savable anymore or print formats don’t work anymore.

Here is one example:

Traceback (most recent call last):
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/frappe/app.py", line 62, in application
    response = frappe.handler.handle()
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/frappe/__init__.py", line 940, in call
    return fn(*args, **newargs)
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/frappe/www/printview.py", line 188, in get_html_and_style
    no_letterhead=no_letterhead, trigger_print=trigger_print),
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/frappe/www/printview.py", line 159, in get_html
    html = template.render(args, filters={"len": len})
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/env/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/env/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/frappe/./templates/print_formats/standard.html", line 32, in top-level template code
    {{ render_field(df, doc) }}
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/env/lib/python2.7/site-packages/jinja2/runtime.py", line 579, in _invoke
    rv = self._func(*arguments)
  File "/Users/dominik/Dev/frappe-dev/frappe-bench/apps/frappe/frappe/./templates/print_formats/standard_macros.html", line 16, in template
    {% include doc.print_templates[df.fieldname] %}
TemplateNotFound: templates/print_formats/includes/total.html

I am trying to debug this but I am not sure where to look. The file printview.py hasn’t been touched in the last 5 days. Today’s changes in bench, frappe and erpnext don’t look suspicious.

The /./looks weird to me but I am not sure where that happens and if that’s a problem.

Our test server running on the same versions is not having these problems. The only difference being that we are in developer mode starting bench in a terminal and the server is serving through nginx in production mode.

Judging from the fact that there is no response to this I am assuming that we are the only ones experiencing this problem.

Hi @dominik,

I cannot reproduce this in ERPNext: v10.1.17 (master) (saving Sales Order on change works, print template seems ok). Maybe something else like specific template changes?

Thank you for your reply. We can replicate this on some of our dev machines but not all, still investigating. Your reply helps!

I think this had to do with Git in some way, deleting the frappe-bench and going from scratch fixed it.