Initial Database Creation Fails

Asked by Iliya Gerov

Dear Experts,

I’ve installed the latest available versions of carbon, whisper and graphite web (v0.9.10). Everything went fine until I performed the step for creating Initial Database. I’m using the default setup with sqlite-3.6.20-1.el6.x86_64 and Django 1.5.1. As described in the installation guide, when I run:

[root@lab-graphit ~]# cd /opt/graphite/webapp/graphite
[root@lab-graphit graphite]# sudo python manage.py syncdb

It gives the following output:

Could not import graphite.local_settings, using defaults!
/usr/lib/python2.6/site-packages/django/core/management/__init__.py:465: DeprecationWarning: The 'execute_manager' function is deprecated, you likely need to update your 'manage.py'; please see the Django 1.4 release notes (https://docs.djangoproject.com/en/dev/releases/1.4/).
  DeprecationWarning)
/usr/lib/python2.6/site-packages/django/core/management/__init__.py:409: DeprecationWarning: The 'setup_environ' function is deprecated, you likely need to update your 'manage.py'; please see the Django 1.4 release notes (https://docs.djangoproject.com/en/dev/releases/1.4/).
  DeprecationWarning)
Could not import graphite.local_settings, using defaults!
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 469, in execute_manager
    utility.execute()
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 272, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 77, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/usr/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 8, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
  File "/usr/lib/python2.6/site-packages/django/core/management/sql.py", line 9, in <module>
    from django.db import models
  File "/usr/lib/python2.6/site-packages/django/db/__init__.py", line 11, in <module>
    if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 152, in __init__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

Can I provide any specific logs in order to clarify the root cause ?

Thank you in advance for your kind assistance!

Regards,
Iliya

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Iliya Gerov
Solved:
Last query:
Last reply:
Revision history for this message
cdgraff (cdgraff) said :
#1

Hi the message say:
 raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")

Check the config where need to have SECRET_KEY with some value.

Regards,
Alejandro

Revision history for this message
Iliya Gerov (iliya-gerov) said :
#2

Hi Alejandro,

Thanks for your response! Actually I solved SECRET_KEY exception yesterday, but the other errors were still there. The good news are that I managed to fixed the issue by downgrading the Django version to 1.3. (Django 1.5 & 1.4 had the issue..)

Thanks & Regards,
Iliya G.

Revision history for this message
mike (gsaray101) said :
#3

I am having the same type of issue. My django version is 1.3 as well. Any ideas?

 PYTHONPATH=$GRAPHITE_ROOT/webapp django-admin.py syncdb --settings=graphite.settings
Traceback (most recent call last):
  File "/usr/local/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/usr/local/lib64/python2.6/site-packages/django/core/management/__init__.py", line 429, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib64/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib64/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib64/python2.6/site-packages/django/core/management/base.py", line 219, in execute
    self.validate()
  File "/usr/local/lib64/python2.6/site-packages/django/core/management/base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "/usr/local/lib64/python2.6/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/usr/local/lib64/python2.6/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/usr/local/lib64/python2.6/site-packages/django/db/models/loading.py", line 64, in _populate
    self.load_app(app_name)
  File "/usr/local/lib64/python2.6/site-packages/django/db/models/loading.py", line 78, in load_app
    models = import_module('.models', app_name)
  File "/usr/local/lib64/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/graphite/webapp/graphite/events/models.py", line 6, in <module>
    from tagging.managers import ModelTaggedItemManager
  File "/usr/local/lib64/python2.6/site-packages/tagging/managers.py", line 8, in <module>
    from .models import Tag, TaggedItem
  File "/usr/local/lib64/python2.6/site-packages/tagging/models.py", line 7, in <module>
    from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name python_2_unicode_compatible

Revision history for this message
Jason Dixon (jason-dixongroup) said :
#4

If you search for that last line "cannot import name python_2_unicode_compatible" you'll find reports of other users with that same error. It seems you're running an incompatible version of django-tagging. You need at least django-tagging==0.3.1.

https://github.com/graphite-project/graphite-web/blob/master/requirements.txt#L43

Jason