graphite-project / graphite-web

A highly scalable real-time graphing system

Home Page:http://graphite.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Q] Directory is not created when following the Pip install method

itinneed2022 opened this issue · comments

Following the pip install, and working on the initial configuration webapp database setup, I'm running into an issue where the folders were not created after running the pip install commands:

(graphite) [root@graphite1 graphite]# PYTHONPATH=$GRAPHITE_ROOT/webapp django-admin.py migrate --settings=graphite.settings
Could not import graphite.local_settings, using defaults!
/opt/graphite/lib/python3.6/site-packages/graphite/settings.py:360: UserWarning: SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security
warn('SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security')
Traceback (most recent call last):
File "/opt/graphite/bin/django-admin.py", line 5, in
management.execute_from_command_line()
File "/opt/graphite/lib/python3.6/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/opt/graphite/lib/python3.6/site-packages/django/core/management/init.py", line 377, in execute
django.setup()
File "/opt/graphite/lib/python3.6/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/graphite/lib/python3.6/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/opt/graphite/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/graphite/lib/python3.6/site-packages/graphite/functions/init.py", line 9, in
from graphite.functions.params import Param, ParamTypes, ParamTypeAggFunc # noqa
File "/opt/graphite/lib/python3.6/site-packages/graphite/functions/params.py", line 3, in
from graphite.errors import InputParameterError
File "/opt/graphite/lib/python3.6/site-packages/graphite/errors.py", line 2, in
from graphite.logger import log
File "/opt/graphite/lib/python3.6/site-packages/graphite/logger.py", line 96, in
log = GraphiteLogger() # import-shared logger instance
File "/opt/graphite/lib/python3.6/site-packages/graphite/logger.py", line 29, in init
level = logging.DEBUG if settings.DEBUG else logging.INFO,
File "/opt/graphite/lib/python3.6/site-packages/graphite/logger.py", line 68, in _config_logger
handler = Rotater(log_file, when=when, backupCount=backupCount)
File "/usr/lib64/python3.6/logging/handlers.py", line 202, in init
BaseRotatingHandler.init(self, filename, 'a', encoding, delay)
File "/usr/lib64/python3.6/logging/handlers.py", line 57, in init
logging.FileHandler.init(self, filename, mode, encoding, delay)
File "/usr/lib64/python3.6/logging/init.py", line 1032, in init
StreamHandler.init(self, self._open())
File "/usr/lib64/python3.6/logging/init.py", line 1061, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/graphite/lib/python3.6/storage/log/webapp/info.log'

Is there a step between the initial database setup and the pip install that I missed? This is just a centos 7 node.

Could not import graphite.local_settings, using defaults!

Did you create local_settings.py file? Looks like it can't read it and falling back to some defaults and fail to properly set GRAPHITE_ROOT (which should be /opt/graphite by default and not /opt/graphite/lib/python3.6/). Or you can create /opt/graphite/lib/python3.6/storage/log/webapp/ directory and try again, but that doesn't look good.

@deniszh That sounds like a step I missed somewhere. Where should I create that file and what goes into it?

it should not be mandatory, default should be /opt/graphite - but it's not working for some reason on your system.

I also have tried the from source version and it also fails on this step. Installing from source in a python3 virtualenv there is not a graphite directory under /opt/graphite/webapp. There is only a content directory.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.