nameError: caches is not defined

Asked by Neil Stack

graphite: 1.1.2
Django==1.11.10

I add relay config to carbon.It's running on the same host.

configs:
PICKLE_RECEIVER_INTERFACE = 0.0.0.0
PICKLE_RECEIVER_PORT = 2004
CACHE_QUERY_INTERFACE = 127.0.0.1
RELAY_METHOD = consistent-hashing
DESTINATIONS = 127.0.0.1:2104:a, 127.0.0.1:2204:b

[cache]
LOCAL_DATA_DIR = /data/graphite/whisper/
LOG_DIR = /data/graphite/log/carbon/
MAX_CREATES_PER_MINUTE = 300

LOG_UPDATES = False
LOG_CACHE_HITS = False
LOG_CACHE_QUEUE_SORTS = False

CARBON_METRIC_PREFIX = stats.carbon
CARBON_METRIC_INTERVAL = 10

[cache:a]
LINE_RECEIVER_PORT = 2103
PICKLE_RECEIVER_PORT = 2104
CACHE_QUERY_PORT = 7102

[cache:b]
LINE_RECEIVER_PORT = 2203
PICKLE_RECEIVER_PORT = 2204
CACHE_QUERY_PORT = 7202

localsetting.py -relevant information

MEMCACHE_HOSTS = ['127.0.0.1:11211']
DEFAULT_CACHE_DURATION = 9

CARBONLINK_HOSTS = ['127.0.0.1:7102:a','127.0.0.1:7202:b']
CARBONLINK_TIMEOUT = 1.0

I am getting this error:
  File "/opt/graphite/bin/django-admin", line 11, in <module>
    sys.exit(execute_from_command_line())
  File "/opt/graphite/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/opt/graphite/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 308, in execute
    settings.INSTALLED_APPS
  File "/opt/graphite/local/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/opt/graphite/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/opt/graphite/local/lib/python2.7/site-packages/django/conf/__init__.py", line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/opt/graphite/webapp/graphite/settings.py", line 226, in <module>
    'TIMEOUT': DEFAULT_CACHE_DURATION,
NameError: name 'CACHES' is not defined

Where should be caches defined ? Should memcache define for both instances ?

Question information

Language:
English Edit question
Status:
Expired
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Neil Stack (linuxlover32) said :
#1

it fails when I run :
/opt/graphite/bin/django-admin migrate --pythonpath /opt/graphite/webapp --noinput --settings=graphite.settings --run-syncdb

Revision history for this message
Denis Zhdanov (deniszhdanov) said :
#2

Probably it's better to show full local_settings.py, probably there's some typo there. CACHES variable is defining in settings.py - https://github.com/graphite-project/graphite-web/blob/2a897cf15a1ad9beb2f919267ef98ce40271bea6/webapp/graphite/settings.py#L92, not sure how you can bypass that declaration.

Revision history for this message
Neil Stack (linuxlover32) said :
#3

TIME_ZONE = 'Etc/UTC'
MEMCACHE_HOSTS = ['127.0.0.1:11211']
DEFAULT_CACHE_DURATION = 9
STORAGE_DIR = '/foo/graphite'
WHISPER_DIR = '/foo/graphite/whisper'
CARBONLINK_HOSTS = ['127.0.0.1:7102:a','127.0.0.1:7202:b']
CARBONLINK_TIMEOUT = 1.0

I haven't define the CACHES in local_settings.py , probably that is the problem ?

Revision history for this message
Denis Zhdanov (deniszhdanov) said :
#4

No, it should not be defined in local_settings.py

Revision history for this message
Neil Stack (linuxlover32) said :
#5

Thing is we also update graphite in same time from 0.9.13 to latest , but some reason it haven't updated settings.py . I will run clean test again.

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Open' state without activity for the last 15 days.