Ok, i resetted my system and started over again:
1. Installed nav from repository -> I assume that I do not have to install more packages, because other packages are installed additionally 2. Followed the guide in /usr/share/doc/nav/README.Debian 3. Followed: https://nav.uninett.no/doc/dev/howto/installing-graphite-on-debian.html
And here I have the first problems, after editing /etc/graphite/local_settings.py I executed graphite-manage migrate auth --noinput
Output: Traceback (most recent call last): File "/usr/bin/graphite-manage", line 15, in <module> execute_from_command_line(sys.argv) File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 341, in execute django.setup() File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate app_config.import_models(all_models) File "/usr/lib/python2.7/dist-packages/django/apps/config.py", line 199, in import_models self.models_module = import_module(models_module_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/usr/lib/python2.7/dist-packages/graphite/account/models.py", line 16, in <module> from django.contrib.auth import models as auth_models File "/usr/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 4, in <module> from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File "/usr/lib/python2.7/dist-packages/django/contrib/auth/base_user.py", line 52, in <module> class AbstractBaseUser(models.Model): File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 119, in __new__ new_class.add_to_class('_meta', Options(meta, app_label)) File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 316, in add_to_class value.contribute_to_class(cls, name) File "/usr/lib/python2.7/dist-packages/django/db/models/options.py", line 214, in contribute_to_class self.db_table = truncate_name(self.db_table, connection.ops.max_name_length()) File "/usr/lib/python2.7/dist-packages/django/db/__init__.py", line 33, in __getattr__ return getattr(connections[DEFAULT_DB_ALIAS], item) File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 211, in __getitem__ backend = load_backend(db['ENGINE']) File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 115, in load_backend return import_module('%s.base' % backend_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/usr/lib/python2.7/dist-packages/django/db/backends/postgresql/base.py", line 24, in <module> raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2
So I tried apt-get install python-psycopg2:
Again I executed: graphite-manage migrate auth --noinput
Traceback (most recent call last): File "/usr/bin/graphite-manage", line 15, in <module> execute_from_command_line(sys.argv) File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 342, in execute self.check() 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/commands/migrate.py", line 62, in _run_checks issues.extend(super(Command, self)._run_checks(**kwargs)) 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
Then: pip list
ackage Version ---------------- ------- attrs 16.3.0 carbon 0.9.15 click 6.6 colorama 0.3.7 constantly 15.1.0 cryptography 1.7.1 Django 1.10.7 django-tagging 0.4.5 enum34 1.1.6 graphite-web 0.9.15 idna 2.2 incremental 16.10.1 ipaddress 1.0.17 PAM 0.4.2 pip 19.0.2 psycopg2 2.6.2 pyasn1 0.1.9 pyasn1-modules 0.0.7 pycrypto 2.6.1 pyOpenSSL 16.2.0 pyparsing 2.1.10 pyserial 3.2.1 python-gammu 2.7 pytz 2016.7 service-identity 16.0.0 setuptools 33.1.1 simplejson 3.10.0 six 1.10.0 sqlparse 0.2.2 Twisted 16.6.0 whisper 0.9.15 zope.interface 4.3.2
So Django is 1.10.7, carbon and graphite-web are 0.9.15.
Ok, the I did: pip uninstall Django pip install "Django>=1.9,<1.9.99"
now:
graphite-manage migrate auth --noinput graphite-manage migrate --noinput
works.
After that I configured the Apache Virtual Host.
Apache is listening on 8000:
netstat -tlpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 490/apache2 tcp 0 0 0.0.0.0:2003 0.0.0.0:* LISTEN 597/python tcp 0 0 0.0.0.0:2004 0.0.0.0:* LISTEN 597/python tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 482/sshd tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 489/postgres tcp 0 0 0.0.0.0:7002 0.0.0.0:* LISTEN 597/python tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 490/apache2 tcp6 0 0 :::22 :::* LISTEN 482/sshd
but, graphite is unreachable:
[Tue Feb 19 08:54:45.694611 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] mod_wsgi (pid=491): Target WSGI script '/usr/share/graphite-web/graphite.wsgi' cannot be loaded as Python module. [Tue Feb 19 08:54:45.694632 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] mod_wsgi (pid=491): Exception occurred processing WSGI script '/usr/share/graphite-web/graphite.wsgi'. [Tue Feb 19 08:54:45.694656 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] Traceback (most recent call last): [Tue Feb 19 08:54:45.694680 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/share/graphite-web/graphite.wsgi", line 18, in <module> [Tue Feb 19 08:54:45.694722 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] import graphite.metrics.search [Tue Feb 19 08:54:45.694750 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/lib/python2.7/dist-packages/graphite/metrics/search.py", line 6, in <module> [Tue Feb 19 08:54:45.694782 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] from graphite.storage import is_pattern, match_entries [Tue Feb 19 08:54:45.694801 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/lib/python2.7/dist-packages/graphite/storage.py", line 9, in <module> [Tue Feb 19 08:54:45.694831 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] from graphite.remote_storage import RemoteStore [Tue Feb 19 08:54:45.694849 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/lib/python2.7/dist-packages/graphite/remote_storage.py", line 8, in <module> [Tue Feb 19 08:54:45.694878 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] from graphite.util import unpickle [Tue Feb 19 08:54:45.694896 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/lib/python2.7/dist-packages/graphite/util.py", line 89, in <module> [Tue Feb 19 08:54:45.694925 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] defaultProfile = Profile.objects.get(user=defaultUser) [Tue Feb 19 08:54:45.694944 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 122, in manager_method [Tue Feb 19 08:54:45.694973 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] return getattr(self.get_queryset(), name)(*args, **kwargs) [Tue Feb 19 08:54:45.694991 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 381, in get [Tue Feb 19 08:54:45.695020 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] num = len(clone) [Tue Feb 19 08:54:45.695038 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 240, in __len__ [Tue Feb 19 08:54:45.695067 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] self._fetch_all() [Tue Feb 19 08:54:45.695085 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 1074, in _fetch_all [Tue Feb 19 08:54:45.695113 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] self._result_cache = list(self.iterator()) [Tue Feb 19 08:54:45.695131 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 52, in __iter__ [Tue Feb 19 08:54:45.695160 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] results = compiler.execute_sql() [Tue Feb 19 08:54:45.695178 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 848, in execute_sql [Tue Feb 19 08:54:45.695207 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] cursor.execute(sql, params) [Tue Feb 19 08:54:45.695225 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute [Tue Feb 19 08:54:45.695254 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] return self.cursor.execute(sql, params) [Tue Feb 19 08:54:45.695272 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 95, in __exit__ [Tue Feb 19 08:54:45.695300 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] six.reraise(dj_exc_type, dj_exc_value, traceback) [Tue Feb 19 08:54:45.695325 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute [Tue Feb 19 08:54:45.695356 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] return self.cursor.execute(sql, params) [Tue Feb 19 08:54:45.695380 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] ProgrammingError: relation "account_profile" does not exist [Tue Feb 19 08:54:45.695390 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] LINE 1: ...e"."history", "account_profile"."advancedUI" FROM "account_p... [Tue Feb 19 08:54:45.695400 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004] ^ [Tue Feb 19 08:54:45.695408 2019] [wsgi:error] [pid 491:tid 139943323834112] [remote 127.0.0.1:55004]
That’s so far. Can you tell me, where to search for more logs to help you?
Cheers Mathias
Am 18.02.19, 16:01 schrieb "Morten Brekkevold" morten.brekkevold@uninett.no:
On Mon, 18 Feb 2019 11:44:34 +0000 "Bothe, Mathias" Mathias.Bothe@eawag.ch wrote:
> thank you for your reply. > Maybe it is a problem with the Django Version installed automatically?
No,
Debian Stretch currently provides python-django 1:1.10.7-2+deb9u4 - the corresponding version of graphite-web in the stretch-backports archive is 1.0.2+debian-2~bpo9+1 is compatible with that version (or the Debian team would not have done their job).
You have failed to provide any kind of information to aid in debugging your issue.
Did you set up your graphite-web Apache virtualhost to listen to port 8000 on any interface? If so, are you able to browse that from your computer? If you set it up to listen only to localhost:8000, are you able to pull it from the server itself, using curl or wget? If not, what is the error? What do the logs say?
The bottom line is: graphite-web must be available as http://localhost:8000/ from your NAV server for this to work.
-- mvh Morten Brekkevold Uninett