Unable to load templates

488 views
Skip to first unread message

Oliver Leaver-Smith

unread,
Mar 14, 2017, 8:02:55 AM3/14/17
to NetBox
Hello,

It doesn't look as though my tables plugin is working correctly. When adding an IP I get the following error:

<class 'django.template.exceptions.TemplateDoesNotExist'> django_tables2/table.html

Using EL 7.3, all versions and permissions look correct

[root@
host netbox]# pip list | grep tables
django-tables2 (1.2.5)
[root@
host netbox]# python --version
Python 2.7.5
[root@
host netbox]# ll templates/table.html
-rw-rw-r-- 1 root root 258 Feb 3 18:59 templates/table.html

My sites/devices/racks pages also load blank as if it is failing to load the template too

Jeremy Stretch

unread,
Mar 14, 2017, 9:18:05 AM3/14/17
to Oliver Leaver-Smith, NetBox
django_tables2/table.html and templates/table.html are different files. The former is included as part of the django-tables2 package; the later is provided by NetBox. Try forcing a reinstallation of the django-tables2 package.

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/e80e3fee-5cb7-4bad-bb50-430267007975%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oliver Leaver-Smith

unread,
Mar 22, 2017, 7:52:24 AM3/22/17
to NetBox
Thanks for the response. I've reinstalled, which was successful, and the package is in place

[root@host ~]# ll /usr/lib/python2.7/site-packages/django_tables2-1.2.5-py2.7.egg
-rw------- 1 root root 116462 Mar 22 11:49 /usr/lib/python2.7/site-packages/django_tables2-1.2.5-py2.7.egg


I am still seeing the same issues though. Is there a way I can put netbox in debug mode to see what it is trying and failing to load? Currently I am still just testing this using the ./manage.py runserver option


On Tuesday, 14 March 2017 13:18:05 UTC, Jeremy Stretch wrote:
django_tables2/table.html and templates/table.html are different files. The former is included as part of the django-tables2 package; the later is provided by NetBox. Try forcing a reinstallation of the django-tables2 package.
On Tue, Mar 14, 2017 at 8:02 AM, Oliver Leaver-Smith <oli...@gmail.com> wrote:
Hello,

It doesn't look as though my tables plugin is working correctly. When adding an IP I get the following error:

<class 'django.template.exceptions.TemplateDoesNotExist'> django_tables2/table.html

Using EL 7.3, all versions and permissions look correct

[root@
host netbox]# pip list | grep tables
django-tables2 (1.2.5)
[root@
host netbox]# python --version
Python 2.7.5
[root@
host netbox]# ll templates/table.html
-rw-rw-r-- 1 root root 258 Feb 3 18:59 templates/table.html

My sites/devices/racks pages also load blank as if it is failing to load the template too

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.

Jeremy Stretch

unread,
Mar 22, 2017, 9:13:52 AM3/22/17
to Oliver Leaver-Smith, NetBox
./manage.py runserver is the debug server for NetBox; the console will output any server errors. What error(s) are you seeing?

To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/30b02fbc-4cc2-4715-8180-d8346c90a5a0%40googlegroups.com.

Oliver Leaver-Smith

unread,
Mar 22, 2017, 9:37:37 AM3/22/17
to NetBox
In those logs I see the following:

[22/Mar/2017 13:35:33] "GET /ipam/ip-addresses/1 HTTP/1.1" 301 0
[22/Mar/2017 13:35:33] "GET /ipam/ip-addresses/1/ HTTP/1.1" 500 1530


The corresponding error on the web page is:

There was a problem with your request. This error has been logged and administrative staff have been notified. Please return to the home page and try again.

If you are responsible for this installation, please consider filing a bug report. Additional information is provided below:

<class 'django.template.exceptions.TemplateDoesNotExist'>
django_tables2/table.html

(attached to ticket)


Thanks
nberror.png

Jeremy Stretch

unread,
Mar 22, 2017, 9:51:05 AM3/22/17
to Oliver Leaver-Smith, NetBox
Try setting DEBUG=True in configuration.py and running it again. It should dump the full stack trace.

To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/2f11ccaf-077f-49ca-a650-221aeb32c6fe%40googlegroups.com.

Oliver Leaver-Smith

unread,
Mar 22, 2017, 10:12:10 AM3/22/17
to NetBox
http://dpaste.com/0K8C2NK

Error during template rendering

In template /opt/netbox/netbox/templates/table.html, error at line 1

django_tables2/table.html

1 {% extends 'django_tables2/table.html' %}
2 {% load django_tables2 %}
3
4 {# Extends the stock django_tables2 template to provide custom formatting of the pagination controls #}
5
6 {% block pagination %}
7 {% include 'paginator.html' %}
8 {% endblock pagination %}
9

Oliver Leaver-Smith

unread,
Mar 22, 2017, 10:13:33 AM3/22/17
to NetBox

Template-loader postmortem

Django tried loading these templates, in this order:

Using engine django:

  • django.template.loaders.filesystem.Loader: /opt/netbox/netbox/templates/django_tables2/table.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/Django-1.10-py2.7.egg/django/contrib/admin/templates/django_tables2/table.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/Django-1.10-py2.7.egg/django/contrib/auth/templates/django_tables2/table.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/django_debug_toolbar-1.7-py2.7.egg/debug_toolbar/templates/django_tables2/table.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /usr/lib/python2.7/site-packages/djangorestframework-3.5.0-py2.7.egg/rest_framework/templates/django_tables2/table.html (Source does not exist)
  • django.template.loaders.app_directories.Loader: /opt/netbox-1.8.4/netbox/secrets/templates/django_tables2/table.html (Source does not exist)
Reply all
Reply to author
Forward
0 new messages