Can't get Graphite running - RuntimeError: populate() isn't reentrant

icinga2

(Lucas Possamai) #1

Hi. I’ve been following this documentation to setup Graphite. I have Icinga 2 running atm.

When going to http://myicingaserver:8000 I get the following error:

[Mon Feb 04 03:24:06.883375 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445] mod_wsgi (pid=400): Target WSGI script '/usr/share/graphite-web/graphite.wsgi' cannot be loaded as Python module.
[Mon Feb 04 03:24:06.883435 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445] mod_wsgi (pid=400): Exception occurred processing WSGI script '/usr/share/graphite-web/graphite.wsgi'.
[Mon Feb 04 03:24:06.883471 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445] Traceback (most recent call last):
[Mon Feb 04 03:24:06.883505 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445]   File "/usr/share/graphite-web/graphite.wsgi", line 14, in <module>
[Mon Feb 04 03:24:06.883589 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445]     application = get_wsgi_application()
[Mon Feb 04 03:24:06.883630 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445]   File "/usr/lib/python2.7/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Mon Feb 04 03:24:06.883707 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445]     django.setup(set_prefix=False)
[Mon Feb 04 03:24:06.883744 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445]   File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
[Mon Feb 04 03:24:06.883811 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445]     apps.populate(settings.INSTALLED_APPS)
[Mon Feb 04 03:24:06.883846 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445]   File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 78, in populate
[Mon Feb 04 03:24:06.883912 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445]     raise RuntimeError("populate() isn't reentrant")
[Mon Feb 04 03:24:06.883958 2019] [wsgi:error] [pid 400] [remote 2x3.xx.xx.2xx:38445] RuntimeError: populate() isn't reentrant

/etc/icinga2/features-enable/graphite.conf:

object GraphiteWriter "graphite" {
  host = "127.0.0.1"
  port = 2003
  enable_send_thresholds = true
  enable_send_metadata = true
}

/etc/apache2/sites-enabled/graphite.conf:

LoadModule wsgi_module modules/mod_wsgi.so

WSGISocketPrefix /var/run/wsgi

Listen 8000
<VirtualHost *:8000>

    ServerName graphite
    ErrorLog ${APACHE_LOG_DIR}/graphite-web_error.log
    CustomLog ${APACHE_LOG_DIR}/graphite-web_access.log combined

    WSGIDaemonProcess graphite-web processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
    WSGIProcessGroup graphite-web
    WSGIApplicationGroup %{GLOBAL}
    WSGIImportScript /usr/share/graphite-web/graphite.wsgi process-group=graphite-web application-group=%{GLOBAL}

    WSGIScriptAlias / /usr/share/graphite-web/graphite.wsgi

    Alias /static/ /usr/share/graphite-web/static/

    <Directory /usr/share/graphite-web/static/>
            <IfVersion < 2.4>
                    Order deny,allow
                    Allow from all
            </IfVersion>
            <IfVersion >= 2.4>
                    Require all granted
            </IfVersion>
    </Directory>
</VirtualHost>

What am I missing here?
Thanks!


(Michael Friedrich) #2

Hi,

the linked documentation doesn’t describe how to setup Graphite, this only covers the integration into Icinga Web 2.

  • How did you manage to install carbon-cache, whisper and graphite-web?
  • Which distribution and version are you on?

Cheers,
Michael