Graphite>0.9.15-1/any graphs on a Raspberry?

Hi everyone,

this posting is a duplicate from the raspberrypi.org forum.

In short: I’m trying to build a Raspberry Pi instance with the following software stack:

  • Icinga2
  • Grafana
  • Graphite + Carbon + Wisper

My problem is that the packages graphite and graphite-web are both version version 0.9.15-1. Both packages are delivered from the offical Raspberry/Debian 9 projekt itself and the versions are too old to work correctly with the Django 1:1.10.7-2+deb9u4 that is coming from the same repository too.

The full error message is:

root@pi:~# graphite-manage runserver
Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x75ddd630>
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 121, in inner_run
    self.check(display_num_errors=True)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 374, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 361, in _run_checks
    return checks.run_checks(**kwargs)
  File "/usr/lib/python2.7/dist-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/lib/python2.7/dist-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/usr/lib/python2.7/dist-packages/django/core/checks/urls.py", line 24, in check_resolver
    for pattern in resolver.url_patterns:
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/lib/python2.7/dist-packages/django/urls/resolvers.py", line 315, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/lib/python2.7/dist-packages/django/urls/resolvers.py", line 308, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/dist-packages/graphite/urls.py", line 29, in <module>
    urlpatterns = patterns('',
NameError: name 'patterns' is not defined

According to graphite-web issue #1816 the django is too new for the graphite.

My questions are:

  • How to fix this? Building a virtual-env seems a little bit to complicated to maintain.
  • Has anybody a newer package for graphite for the Pi?
  • Is there an easy way to build packages for the Pi?
  • Has anybody has a Raspberry running with any kind of graphs?

Hi,

since Graphite is purely written in Python, I am using the pip way to install it in my Puppet modules and profiles (that is, inside the standalone Vagrant box for example).

I don’t think that you’ll need a virtualenv for this, just ensure that pip is installed and manage the setup with it. Also, you’ll likely need to pin the Django versions somehow, I always have seen that newer Django and Twisted versions break lots of things.

See the class instantiation here, I’ve pinned Django and Twisted there as well.

I’m not sure if there is a better method for this at the moment - provisioning the Vagrant boxes works fine since the very beginning. Probably you can learn some things from that, or find a better howto for Raspbian/Debian which includes installing Graphite via pip :slight_smile:

Cheers,
Michael