Closed TinajaLabs closed 5 years ago
BTW, I've also researched other references to this problem.
I've tried chown variations.
I've set different users and group combinations of root
, graphite
, and www-data
.
I ran this:
# PYTHONPATH=/opt/graphite/webapp django-admin.py migrate --settings=graphite.settings --run-syncdb
Operations to perform:
Synchronize unmigrated apps: browser, composer, functions, metrics, render, staticfiles, whitelist
Apply all migrations: account, admin, auth, contenttypes, dashboard, events, sessions, tagging, tags, url_shortener
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Running migrations:
No migrations to apply.
Still no joy...
Hello! Your database file is owned by user graphite and group root hence not readable by Apache user (not sure which one, it’s OS dependent). You need to make Apache user able to read and write graphite.db file, e.g. by chown command.
On Mon, 10 Dec 2018 at 07:48, Chris Jefferies notifications@github.com wrote:
I'm trying to create a repeatable install with Ansible. None of the existing Ansible modules (roles) work in my environment so integrating various pieces. The end game is to collect metrics and get them into Grafana.
Most of it has come together - I have Apache working with mod_wsgi 4.6.5, Carbon is receiving metrics and storing it in Whisper, Grafana launches beautifully... but can't get past this database error. This one is killin' me.
Any tips mercifully appreciated. Thanks.
Using:
Apache 2.4, mod_wsgi 4.6.5, Graphite, Carbon, Whisper 1.1.3, Python 2.7, Django 1.11.17, geerlingguy.apache (ansible role), nsg.graphite (forked and modifying)
Configured in debug mode (set in opt/graphite/webapp/graphite/local_settings.py):
Request Method: GET Request URL: http://tinaja-gr:8080/composer Django Version: 1.11.17 Exception Type: OperationalError Exception Value:
unable to open database file Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py in execute, line 328 Python Executable: /usr/bin/python Python Version: 2.7.13 Python Path:
['/usr/lib/python2.7', '/usr/lib/python2.7/plat-arm-linux-gnueabihf', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/opt/graphite/webapp']```The graphite.db file:
total 336 drwxr-xr-x 7 graphite root 4096 Dec 9 23:27 . drwxr-xr-x 8 root root 4096 Dec 9 21:33 .. -rw-r--r-- 1 graphite graphite 3 Dec 9 23:27 carbon-cache-a.pid drwxr-xr-x 3 graphite root 4096 Dec 9 21:33 ceres -rwxrwxr-x 1 www-data www-data 311296 Dec 9 21:34 graphite.db drwxr-xr-x 2 graphite root 4096 Dec 9 21:33 lists drwxr-xr-x 4 graphite root 4096 Dec 9 21:33 log drwxr-xr-x 3 graphite root 4096 Dec 9 21:33 rrd drwxr-xr-x 5 graphite root 4096 Dec 9 21:34 whisper The database layout in local_settings.py DATABASES = { 'default': { 'NAME': '/opt/graphite/storage/graphite.db', 'ENGINE': 'django.db.backends.sqlite3', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '' } } Stack trace: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/graphite/webapp/graphite/composer/views.py" in composer 35. profile = getProfile(request) File "/opt/graphite/webapp/graphite/user_util.py" in getProfile 25. return default_profile() File "/opt/graphite/webapp/graphite/user_util.py" in default_profile 41. 'password': '!'}) File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py" in manager_method 85. return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in get_or_create 466. return self._create_object_from_params(lookup, params) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _create_object_from_params 500. obj = self.create(**params) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in create 394. obj.save(force_insert=True, using=self.db) File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/base_user.py" in save 80. super(AbstractBaseUser, self).save(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in save 808. force_update=force_update, update_fields=update_fields) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in save_base 838. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in _save_table 924. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in _do_insert 963. using=using, raw=raw) File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py" in manager_method 85. return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _insert 1079. return query.get_compiler(using=using).execute_sql(return_id) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in execute_sql 1112. cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute 79. return super(CursorDebugWrapper, self).execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute 64. return self.cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py" in __exit__ 94. six.reraise(dj_exc_type, dj_exc_value, traceback) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute 64. return self.cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py" in execute 328. return Database.Cursor.execute(self, query, params) Exception Type: OperationalError at /composer Exception Value: unable to open database file Graphite.settings: Setting | Value -- | -- ABSOLUTE_URL_OVERRIDES | {} ADMINS | [] ALLOWED_HOSTS | ['*'] ALLOW_ANONYMOUS_CLI | True APPEND_SLASH | False AUTHENTICATION_BACKENDS | ['django.contrib.auth.backends.ModelBackend'] AUTH_PASSWORD_VALIDATORS | u'********************' AUTH_USER_MODEL | u'auth.User' AUTO_REFRESH_INTERVAL | 60 CACHES | {'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}} CACHE_MIDDLEWARE_ALIAS | u'default' CACHE_MIDDLEWARE_KEY_PREFIX | u'********************' CACHE_MIDDLEWARE_SECONDS | 600 CARBONLINK_HASHING_KEYFUNC | u'********************' CARBONLINK_HASHING_TYPE | 'carbon_ch' CARBONLINK_HOSTS | ['127.0.0.1:7002'] CARBONLINK_RETRY_DELAY | 15 CARBONLINK_TIMEOUT | 1.0 CARBON_METRIC_PREFIX | 'carbon' CERES_DIR | '/opt/graphite/storage/ceres/' CLUSTER_SERVERS | [] CONF_DIR | '/opt/graphite/conf' CSRF_COOKIE_AGE | 31449600 CSRF_COOKIE_DOMAIN | None CSRF_COOKIE_HTTPONLY | False CSRF_COOKIE_NAME | u'csrftoken' CSRF_COOKIE_PATH | u'/' CSRF_COOKIE_SECURE | False CSRF_FAILURE_VIEW | u'django.views.csrf.csrf_failure' CSRF_HEADER_NAME | u'HTTP_X_CSRFTOKEN' CSRF_TRUSTED_ORIGINS | [] CSRF_USE_SESSIONS | False DASHBOARD_CONF | '/opt/graphite/conf/dashboard.conf' DASHBOARD_REQUIRE_AUTHENTICATION | False DASHBOARD_REQUIRE_EDIT_GROUP | None DASHBOARD_REQUIRE_PERMISSIONS | False DATABASES | {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.sqlite3', 'HOST': '', 'NAME': '/opt/graphite/storage/graphite.db', 'OPTIONS': {}, 'PASSWORD': u'********************', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': ''}} DATABASE_ROUTERS | [] DATA_UPLOAD_MAX_MEMORY_SIZE | 2621440 DATA_UPLOAD_MAX_NUMBER_FIELDS | 1000 DATETIME_FORMAT | u'N j, Y, P' DATETIME_INPUT_FORMATS | [u'%Y-%m-%d %H:%M:%S', u'%Y-%m-%d %H:%M:%S.%f', u'%Y-%m-%d %H:%M', u'%Y-%m-%d', u'%m/%d/%Y %H:%M:%S', u'%m/%d/%Y %H:%M:%S.%f', u'%m/%d/%Y %H:%M', u'%m/%d/%Y', u'%m/%d/%y %H:%M:%S', u'%m/%d/%y %H:%M:%S.%f', u'%m/%d/%y %H:%M', u'%m/%d/%y'] DATE_FORMAT | '%m/%d' DATE_INPUT_FORMATS | [u'%Y-%m-%d', u'%m/%d/%Y', u'%m/%d/%y', u'%b %d %Y', u'%b %d, %Y', u'%d %b %Y', u'%d %b, %Y', u'%B %d %Y', u'%B %d, %Y', u'%d %B %Y', u'%d %B, %Y'] DEBUG | True DEBUG_PROPAGATE_EXCEPTIONS | False DECIMAL_SEPARATOR | u'.' DEFAULT_CACHE_DURATION | 60 DEFAULT_CACHE_POLICY | [] DEFAULT_CHARSET | u'utf-8' DEFAULT_CONTENT_TYPE | u'text/html' DEFAULT_EXCEPTION_REPORTER_FILTER | u'django.views.debug.SafeExceptionReporterFilter' DEFAULT_FILE_STORAGE | u'django.core.files.storage.FileSystemStorage' DEFAULT_FROM_EMAIL | u'webmaster@localhost' DEFAULT_INDEX_TABLESPACE | u'' DEFAULT_TABLESPACE | u'' DEFAULT_XFILES_FACTOR | 0 DISALLOWED_USER_AGENTS | [] DJANGO_VERSION | (1, 11, 17, u'final', 0) DOCUMENTATION_URL | 'https://graphite.readthedocs.io/en/1.1.3/' DOCUMENTATION_VERSION | '1.1.3' EMAIL_BACKEND | u'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST | u'localhost' EMAIL_HOST_PASSWORD | u'********************' EMAIL_HOST_USER | u'' EMAIL_PORT | 25 EMAIL_SSL_CERTFILE | None EMAIL_SSL_KEYFILE | u'********************' EMAIL_SUBJECT_PREFIX | u'[Django] ' EMAIL_TIMEOUT | None EMAIL_USE_LOCALTIME | False EMAIL_USE_SSL | False EMAIL_USE_TLS | False FETCH_TIMEOUT | 6.0 FILE_CHARSET | u'utf-8' FILE_UPLOAD_DIRECTORY_PERMISSIONS | None FILE_UPLOAD_HANDLERS | [u'django.core.files.uploadhandler.MemoryFileUploadHandler', u'django.core.files.uploadhandler.TemporaryFileUploadHandler'] FILE_UPLOAD_MAX_MEMORY_SIZE | 2621440 FILE_UPLOAD_PERMISSIONS | None FILE_UPLOAD_TEMP_DIR | None FIND_CACHE_DURATION | 300 FIND_TIMEOUT | 3.0 FIND_TOLERANCE | 600 FIRST_DAY_OF_WEEK | 0 FIXTURE_DIRS | [] FLUSHRRDCACHED | '' FORCE_SCRIPT_NAME | None FORMAT_MODULE_PATH | None FORM_RENDERER | u'django.forms.renderers.DjangoTemplates' FUNCTION_PLUGINS | [] GRAPHITE_ROOT | '/opt/graphite' GRAPHITE_WEB_APP_SETTINGS_LOADED | True GRAPHTEMPLATES_CONF | '/opt/graphite/conf/graphTemplates.conf' IGNORABLE_404_URLS | [] INDEX_FILE | '/opt/graphite/storage/index' INSTALLED_APPS | ('graphite.account', 'graphite.browser', 'graphite.composer', 'graphite.dashboard', 'graphite.events', 'graphite.functions', 'graphite.metrics', 'graphite.render', 'graphite.tags', 'graphite.url_shortener', 'graphite.whitelist', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.staticfiles', 'tagging') INTERNAL_IPS | [] INTRACLUSTER_HTTPS | False JAVASCRIPT_DEBUG | False LANGUAGES | [(u'af', u'Afrikaans'), (u'ar', u'Arabic'), (u'ast', u'Asturian'), (u'az', u'Azerbaijani'), (u'bg', u'Bulgarian'), (u'be', u'Belarusian'), (u'bn', u'Bengali'), (u'br', u'Breton'), (u'bs', u'Bosnian'), (u'ca', u'Catalan'), (u'cs', u'Czech'), (u'cy', u'Welsh'), (u'da', u'Danish'), (u'de', u'German'), (u'dsb', u'Lower Sorbian'), (u'el', u'Greek'), (u'en', u'English'), (u'en-au', u'Australian English'), (u'en-gb', u'British English'), (u'eo', u'Esperanto'), (u'es', u'Spanish'), (u'es-ar', u'Argentinian Spanish'), (u'es-co', u'Colombian Spanish'), (u'es-mx', u'Mexican Spanish'), (u'es-ni', u'Nicaraguan Spanish'), (u'es-ve', u'Venezuelan Spanish'), (u'et', u'Estonian'), (u'eu', u'Basque'), (u'fa', u'Persian'), (u'fi', u'Finnish'), (u'fr', u'French'), (u'fy', u'Frisian'), (u'ga', u'Irish'), (u'gd', u'Scottish Gaelic'), (u'gl', u'Galician'), (u'he', u'Hebrew'), (u'hi', u'Hindi'), (u'hr', u'Croatian'), (u'hsb', u'Upper Sorbian'), (u'hu', u'Hungarian'), (u'ia', u'Interlingua'), (u'id', u'Indonesian'), (u'io', u'Ido'), (u'is', u'Icelandic'), (u'it', u'Italian'), (u'ja', u'Japanese'), (u'ka', u'Georgian'), (u'kk', u'Kazakh'), (u'km', u'Khmer'), (u'kn', u'Kannada'), (u'ko', u'Korean'), (u'lb', u'Luxembourgish'), (u'lt', u'Lithuanian'), (u'lv', u'Latvian'), (u'mk', u'Macedonian'), (u'ml', u'Malayalam'), (u'mn', u'Mongolian'), (u'mr', u'Marathi'), (u'my', u'Burmese'), (u'nb', u'Norwegian Bokm\xe5l'), (u'ne', u'Nepali'), (u'nl', u'Dutch'), (u'nn', u'Norwegian Nynorsk'), (u'os', u'Ossetic'), (u'pa', u'Punjabi'), (u'pl', u'Polish'), (u'pt', u'Portuguese'), (u'pt-br', u'Brazilian Portuguese'), (u'ro', u'Romanian'), (u'ru', u'Russian'), (u'sk', u'Slovak'), (u'sl', u'Slovenian'), (u'sq', u'Albanian'), (u'sr', u'Serbian'), (u'sr-latn', u'Serbian Latin'), (u'sv', u'Swedish'), (u'sw', u'Swahili'), (u'ta', u'Tamil'), (u'te', u'Telugu'), (u'th', u'Thai'), (u'tr', u'Turkish'), (u'tt', u'Tatar'), (u'udm', u'Udmurt'), (u'uk', u'Ukrainian'), (u'ur', u'Urdu'), (u'vi', u'Vietnamese'), (u'zh-hans', u'Simplified Chinese'), (u'zh-hant', u'Traditional Chinese')] LANGUAGES_BIDI | [u'he', u'ar', u'fa', u'ur'] LANGUAGE_CODE | 'en-us' LANGUAGE_COOKIE_AGE | None LANGUAGE_COOKIE_DOMAIN | None LANGUAGE_COOKIE_NAME | u'django_language' LANGUAGE_COOKIE_PATH | u'/' LDAP_BASE_PASS | u'********************' LDAP_BASE_USER | '' LDAP_PORT | 389 LDAP_SEARCH_BASE | '' LDAP_SERVER | '' LDAP_URI | None LDAP_USER_DN_TEMPLATE | None LDAP_USER_QUERY | '' LDAP_USE_TLS | False LEGEND_MAX_ITEMS | 10 LOCALE_PATHS | [] LOGGING | {} LOGGING_CONFIG | u'logging.config.dictConfig' LOGIN_REDIRECT_URL | u'/accounts/profile/' LOGIN_URL | u'/account/login' LOGOUT_REDIRECT_URL | None LOG_CACHE_PERFORMANCE | False LOG_DIR | '/opt/graphite/storage/log/webapp' LOG_FILE_CACHE | 'cache.log' LOG_FILE_EXCEPTION | 'exception.log' LOG_FILE_INFO | 'info.log' LOG_FILE_RENDERING | 'rendering.log' LOG_RENDERING_PERFORMANCE | False LOG_ROTATION | True LOG_ROTATION_COUNT | 1 MANAGERS | [] MAX_FETCH_RETRIES | 2 MAX_TAG_LENGTH | 50 MEDIA_ROOT | '' MEDIA_URL | '' MEMCACHE_HOSTS | [] MEMCACHE_KEY_PREFIX | u'********************' MEMCACHE_OPTIONS | {} MESSAGE_STORAGE | u'django.contrib.messages.storage.fallback.FallbackStorage' METRICS_FIND_FAILURE_THRESHOLD | inf METRICS_FIND_WARNING_THRESHOLD | inf MIDDLEWARE | ('graphite.middleware.LogExceptionsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.gzip.GZipMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') MIDDLEWARE_CLASSES | [u'django.middleware.common.CommonMiddleware', u'django.middleware.csrf.CsrfViewMiddleware'] MIGRATION_MODULES | {} MONTH_DAY_FORMAT | u'F j' NUMBER_GROUPING | 0 PASSWORD_HASHERS | u'********************' PASSWORD_RESET_TIMEOUT_DAYS | u'********************' POOL_MAX_WORKERS | 10 PREPEND_WWW | False REMOTE_BUFFER_SIZE | 1048576 REMOTE_EXCLUDE_LOCAL | False REMOTE_FETCH_TIMEOUT | None REMOTE_FIND_TIMEOUT | None REMOTE_RENDERING | False REMOTE_RENDER_CONNECT_TIMEOUT | 1.0 REMOTE_RETRY_DELAY | 60.0 REMOTE_STORE_FORWARD_HEADERS | [] REMOTE_STORE_MERGE_RESULTS | True REMOTE_STORE_USE_POST | False REMOTE_USER_BACKEND | '' REMOTE_USER_MIDDLEWARE | '' RENDERING_HOSTS | [] REPLICATION_FACTOR | 1 ROOT_URLCONF | 'graphite.urls' RRD_CF | 'AVERAGE' RRD_DIR | '/opt/graphite/storage/rrd/' SECRET_KEY | u'********************' SECURE_BROWSER_XSS_FILTER | False SECURE_CONTENT_TYPE_NOSNIFF | False SECURE_HSTS_INCLUDE_SUBDOMAINS | False SECURE_HSTS_PRELOAD | False SECURE_HSTS_SECONDS | 0 SECURE_PROXY_SSL_HEADER | None SECURE_REDIRECT_EXEMPT | [] SECURE_SSL_HOST | None SECURE_SSL_REDIRECT | False SERVER_EMAIL | u'root@localhost' SESSION_CACHE_ALIAS | u'default' SESSION_COOKIE_AGE | 1209600 SESSION_COOKIE_DOMAIN | None SESSION_COOKIE_HTTPONLY | True SESSION_COOKIE_NAME | u'sessionid' SESSION_COOKIE_PATH | u'/' SESSION_COOKIE_SECURE | False SESSION_ENGINE | u'django.contrib.sessions.backends.db' SESSION_EXPIRE_AT_BROWSER_CLOSE | False SESSION_FILE_PATH | None SESSION_SAVE_EVERY_REQUEST | False SESSION_SERIALIZER | u'django.contrib.sessions.serializers.JSONSerializer' SETTINGS_MODULE | 'graphite.settings' SHORT_DATETIME_FORMAT | u'm/d/Y P' SHORT_DATE_FORMAT | u'm/d/Y' SIGNING_BACKEND | u'django.core.signing.TimestampSigner' SILENCED_SYSTEM_CHECKS | ['urls.W002'] SMTP_SERVER | 'localhost' STANDARD_DIRS | ['/opt/graphite/storage/whisper/'] STATICFILES_DIRS | ('/opt/graphite/webapp/content',) STATICFILES_FINDERS | [u'django.contrib.staticfiles.finders.FileSystemFinder', u'django.contrib.staticfiles.finders.AppDirectoriesFinder'] STATICFILES_STORAGE | u'django.contrib.staticfiles.storage.StaticFilesStorage' STATIC_ROOT | '/opt/graphite/static' STATIC_URL | '/static/' STORAGE_DIR | '/opt/graphite/storage' STORAGE_FINDERS | ('graphite.finders.remote.RemoteFinder', 'graphite.finders.standard.StandardFinder') TAGDB | 'graphite.tags.localdatabase.LocalDatabaseTagDB' TAGDB_AUTOCOMPLETE_LIMIT | 100 TAGDB_CACHE_DURATION | 60 TAGDB_HTTP_AUTOCOMPLETE | False TAGDB_HTTP_PASSWORD | u'********************' TAGDB_HTTP_URL | '' TAGDB_HTTP_USER | '' TAGDB_REDIS_DB | 0 TAGDB_REDIS_HOST | 'localhost' TAGDB_REDIS_PORT | 6379 TEMPLATES | [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/opt/graphite/webapp/graphite/templates'], 'OPTIONS': {'context_processors': ['django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages']}}] TEMPLATE_DEBUG | False TEST_NON_SERIALIZED_APPS | [] TEST_RUNNER | u'django.test.runner.DiscoverRunner' THOUSAND_SEPARATOR | u',' TIME_FORMAT | u'P' TIME_INPUT_FORMATS | [u'%H:%M:%S', u'%H:%M:%S.%f', u'%H:%M'] TIME_ZONE | 'America/Chicago' URL_PREFIX | '' USE_ETAGS | False USE_I18N | True USE_L10N | False USE_LDAP_AUTH | False USE_REMOTE_USER_AUTHENTICATION | False USE_THOUSAND_SEPARATOR | False USE_TZ | True USE_WORKER_POOL | True USE_X_FORWARDED_HOST | False USE_X_FORWARDED_PORT | False WEBAPP_DIR | '/opt/graphite/webapp' WEBAPP_VERSION | '1.1.3' WEB_DIR | '/opt/graphite/webapp/graphite' WHISPER_DIR | '/opt/graphite/storage/whisper/' WHITELIST_FILE | '/opt/graphite/storage/lists/whitelist' WSGI_APPLICATION | None X_FRAME_OPTIONS | u'SAMEORIGIN' YEAR_MONTH_FORMAT | u'F Y' — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/graphite-project/graphite-web/issues/2393>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABK51pLtBEVZDUC4elawsYLh4nVO7nnLks5u3gO3gaJpZM4ZKwPR> .
You can make file owned by graphite user and www-data group, and ofc writable both for user and group - should work. No magic here - Graphite-web is generic web application, which run under user of web server.
On Mon, 10 Dec 2018 at 08:04, Denis Zhdanov denis.zhdanov@gmail.com wrote:
Hello! Your database file is owned by user graphite and group root hence not readable by Apache user (not sure which one, it’s OS dependent). You need to make Apache user able to read and write graphite.db file, e.g. by chown command.
On Mon, 10 Dec 2018 at 07:48, Chris Jefferies notifications@github.com wrote:
I'm trying to create a repeatable install with Ansible. None of the existing Ansible modules (roles) work in my environment so integrating various pieces. The end game is to collect metrics and get them into Grafana.
Most of it has come together - I have Apache working with mod_wsgi 4.6.5, Carbon is receiving metrics and storing it in Whisper, Grafana launches beautifully... but can't get past this database error. This one is killin' me.
Any tips mercifully appreciated. Thanks.
Using:
Apache 2.4, mod_wsgi 4.6.5, Graphite, Carbon, Whisper 1.1.3, Python 2.7, Django 1.11.17, geerlingguy.apache (ansible role), nsg.graphite (forked and modifying)
Configured in debug mode (set in opt/graphite/webapp/graphite/local_settings.py):
Request Method: GET Request URL: http://tinaja-gr:8080/composer Django Version: 1.11.17 Exception Type: OperationalError Exception Value: unable to open database file Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py in execute, line 328 Python Executable: /usr/bin/python Python Version: 2.7.13 Python Path: ['/usr/lib/python2.7', '/usr/lib/python2.7/plat-arm-linux-gnueabihf', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/opt/graphite/webapp']```
The graphite.db file:
total 336 drwxr-xr-x 7 graphite root 4096 Dec 9 23:27 . drwxr-xr-x 8 root root 4096 Dec 9 21:33 .. -rw-r--r-- 1 graphite graphite 3 Dec 9 23:27 carbon-cache-a.pid drwxr-xr-x 3 graphite root 4096 Dec 9 21:33 ceres -rwxrwxr-x 1 www-data www-data 311296 Dec 9 21:34 graphite.db drwxr-xr-x 2 graphite root 4096 Dec 9 21:33 lists drwxr-xr-x 4 graphite root 4096 Dec 9 21:33 log drwxr-xr-x 3 graphite root 4096 Dec 9 21:33 rrd drwxr-xr-x 5 graphite root 4096 Dec 9 21:34 whisper The database layout in local_settings.py DATABASES = { 'default': { 'NAME': '/opt/graphite/storage/graphite.db', 'ENGINE': 'django.db.backends.sqlite3', 'USER': '', 'PASSWORD': '', 'HOST': '', 'PORT': '' } } Stack trace: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/graphite/webapp/graphite/composer/views.py" in composer 35. profile = getProfile(request) File "/opt/graphite/webapp/graphite/user_util.py" in getProfile 25. return default_profile() File "/opt/graphite/webapp/graphite/user_util.py" in default_profile 41. 'password': '!'}) File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py" in manager_method 85. return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in get_or_create 466. return self._create_object_from_params(lookup, params) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _create_object_from_params 500. obj = self.create(**params) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in create 394. obj.save(force_insert=True, using=self.db) File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/base_user.py" in save 80. super(AbstractBaseUser, self).save(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in save 808. force_update=force_update, update_fields=update_fields) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in save_base 838. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in _save_table 924. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py" in _do_insert 963. using=using, raw=raw) File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py" in manager_method 85. return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in _insert 1079. return query.get_compiler(using=using).execute_sql(return_id) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in execute_sql 1112. cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute 79. return super(CursorDebugWrapper, self).execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute 64. return self.cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py" in __exit__ 94. six.reraise(dj_exc_type, dj_exc_value, traceback) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py" in execute 64. return self.cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py" in execute 328. return Database.Cursor.execute(self, query, params) Exception Type: OperationalError at /composer Exception Value: unable to open database file Graphite.settings: Setting | Value -- | -- ABSOLUTE_URL_OVERRIDES | {} ADMINS | [] ALLOWED_HOSTS | ['*'] ALLOW_ANONYMOUS_CLI | True APPEND_SLASH | False AUTHENTICATION_BACKENDS | ['django.contrib.auth.backends.ModelBackend'] AUTH_PASSWORD_VALIDATORS | u'********************' AUTH_USER_MODEL | u'auth.User' AUTO_REFRESH_INTERVAL | 60 CACHES | {'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}} CACHE_MIDDLEWARE_ALIAS | u'default' CACHE_MIDDLEWARE_KEY_PREFIX | u'********************' CACHE_MIDDLEWARE_SECONDS | 600 CARBONLINK_HASHING_KEYFUNC | u'********************' CARBONLINK_HASHING_TYPE | 'carbon_ch' CARBONLINK_HOSTS | ['127.0.0.1:7002'] CARBONLINK_RETRY_DELAY | 15 CARBONLINK_TIMEOUT | 1.0 CARBON_METRIC_PREFIX | 'carbon' CERES_DIR | '/opt/graphite/storage/ceres/' CLUSTER_SERVERS | [] CONF_DIR | '/opt/graphite/conf' CSRF_COOKIE_AGE | 31449600 CSRF_COOKIE_DOMAIN | None CSRF_COOKIE_HTTPONLY | False CSRF_COOKIE_NAME | u'csrftoken' CSRF_COOKIE_PATH | u'/' CSRF_COOKIE_SECURE | False CSRF_FAILURE_VIEW | u'django.views.csrf.csrf_failure' CSRF_HEADER_NAME | u'HTTP_X_CSRFTOKEN' CSRF_TRUSTED_ORIGINS | [] CSRF_USE_SESSIONS | False DASHBOARD_CONF | '/opt/graphite/conf/dashboard.conf' DASHBOARD_REQUIRE_AUTHENTICATION | False DASHBOARD_REQUIRE_EDIT_GROUP | None DASHBOARD_REQUIRE_PERMISSIONS | False DATABASES | {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.sqlite3', 'HOST': '', 'NAME': '/opt/graphite/storage/graphite.db', 'OPTIONS': {}, 'PASSWORD': u'********************', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': ''}} DATABASE_ROUTERS | [] DATA_UPLOAD_MAX_MEMORY_SIZE | 2621440 DATA_UPLOAD_MAX_NUMBER_FIELDS | 1000 DATETIME_FORMAT | u'N j, Y, P' DATETIME_INPUT_FORMATS | [u'%Y-%m-%d %H:%M:%S', u'%Y-%m-%d %H:%M:%S.%f', u'%Y-%m-%d %H:%M', u'%Y-%m-%d', u'%m/%d/%Y %H:%M:%S', u'%m/%d/%Y %H:%M:%S.%f', u'%m/%d/%Y %H:%M', u'%m/%d/%Y', u'%m/%d/%y %H:%M:%S', u'%m/%d/%y %H:%M:%S.%f', u'%m/%d/%y %H:%M', u'%m/%d/%y'] DATE_FORMAT | '%m/%d' DATE_INPUT_FORMATS | [u'%Y-%m-%d', u'%m/%d/%Y', u'%m/%d/%y', u'%b %d %Y', u'%b %d, %Y', u'%d %b %Y', u'%d %b, %Y', u'%B %d %Y', u'%B %d, %Y', u'%d %B %Y', u'%d %B, %Y'] DEBUG | True DEBUG_PROPAGATE_EXCEPTIONS | False DECIMAL_SEPARATOR | u'.' DEFAULT_CACHE_DURATION | 60 DEFAULT_CACHE_POLICY | [] DEFAULT_CHARSET | u'utf-8' DEFAULT_CONTENT_TYPE | u'text/html' DEFAULT_EXCEPTION_REPORTER_FILTER | u'django.views.debug.SafeExceptionReporterFilter' DEFAULT_FILE_STORAGE | u'django.core.files.storage.FileSystemStorage' DEFAULT_FROM_EMAIL | u'webmaster@localhost' DEFAULT_INDEX_TABLESPACE | u'' DEFAULT_TABLESPACE | u'' DEFAULT_XFILES_FACTOR | 0 DISALLOWED_USER_AGENTS | [] DJANGO_VERSION | (1, 11, 17, u'final', 0) DOCUMENTATION_URL | 'https://graphite.readthedocs.io/en/1.1.3/' DOCUMENTATION_VERSION | '1.1.3' EMAIL_BACKEND | u'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST | u'localhost' EMAIL_HOST_PASSWORD | u'********************' EMAIL_HOST_USER | u'' EMAIL_PORT | 25 EMAIL_SSL_CERTFILE | None EMAIL_SSL_KEYFILE | u'********************' EMAIL_SUBJECT_PREFIX | u'[Django] ' EMAIL_TIMEOUT | None EMAIL_USE_LOCALTIME | False EMAIL_USE_SSL | False EMAIL_USE_TLS | False FETCH_TIMEOUT | 6.0 FILE_CHARSET | u'utf-8' FILE_UPLOAD_DIRECTORY_PERMISSIONS | None FILE_UPLOAD_HANDLERS | [u'django.core.files.uploadhandler.MemoryFileUploadHandler', u'django.core.files.uploadhandler.TemporaryFileUploadHandler'] FILE_UPLOAD_MAX_MEMORY_SIZE | 2621440 FILE_UPLOAD_PERMISSIONS | None FILE_UPLOAD_TEMP_DIR | None FIND_CACHE_DURATION | 300 FIND_TIMEOUT | 3.0 FIND_TOLERANCE | 600 FIRST_DAY_OF_WEEK | 0 FIXTURE_DIRS | [] FLUSHRRDCACHED | '' FORCE_SCRIPT_NAME | None FORMAT_MODULE_PATH | None FORM_RENDERER | u'django.forms.renderers.DjangoTemplates' FUNCTION_PLUGINS | [] GRAPHITE_ROOT | '/opt/graphite' GRAPHITE_WEB_APP_SETTINGS_LOADED | True GRAPHTEMPLATES_CONF | '/opt/graphite/conf/graphTemplates.conf' IGNORABLE_404_URLS | [] INDEX_FILE | '/opt/graphite/storage/index' INSTALLED_APPS | ('graphite.account', 'graphite.browser', 'graphite.composer', 'graphite.dashboard', 'graphite.events', 'graphite.functions', 'graphite.metrics', 'graphite.render', 'graphite.tags', 'graphite.url_shortener', 'graphite.whitelist', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.staticfiles', 'tagging') INTERNAL_IPS | [] INTRACLUSTER_HTTPS | False JAVASCRIPT_DEBUG | False LANGUAGES | [(u'af', u'Afrikaans'), (u'ar', u'Arabic'), (u'ast', u'Asturian'), (u'az', u'Azerbaijani'), (u'bg', u'Bulgarian'), (u'be', u'Belarusian'), (u'bn', u'Bengali'), (u'br', u'Breton'), (u'bs', u'Bosnian'), (u'ca', u'Catalan'), (u'cs', u'Czech'), (u'cy', u'Welsh'), (u'da', u'Danish'), (u'de', u'German'), (u'dsb', u'Lower Sorbian'), (u'el', u'Greek'), (u'en', u'English'), (u'en-au', u'Australian English'), (u'en-gb', u'British English'), (u'eo', u'Esperanto'), (u'es', u'Spanish'), (u'es-ar', u'Argentinian Spanish'), (u'es-co', u'Colombian Spanish'), (u'es-mx', u'Mexican Spanish'), (u'es-ni', u'Nicaraguan Spanish'), (u'es-ve', u'Venezuelan Spanish'), (u'et', u'Estonian'), (u'eu', u'Basque'), (u'fa', u'Persian'), (u'fi', u'Finnish'), (u'fr', u'French'), (u'fy', u'Frisian'), (u'ga', u'Irish'), (u'gd', u'Scottish Gaelic'), (u'gl', u'Galician'), (u'he', u'Hebrew'), (u'hi', u'Hindi'), (u'hr', u'Croatian'), (u'hsb', u'Upper Sorbian'), (u'hu', u'Hungarian'), (u'ia', u'Interlingua'), (u'id', u'Indonesian'), (u'io', u'Ido'), (u'is', u'Icelandic'), (u'it', u'Italian'), (u'ja', u'Japanese'), (u'ka', u'Georgian'), (u'kk', u'Kazakh'), (u'km', u'Khmer'), (u'kn', u'Kannada'), (u'ko', u'Korean'), (u'lb', u'Luxembourgish'), (u'lt', u'Lithuanian'), (u'lv', u'Latvian'), (u'mk', u'Macedonian'), (u'ml', u'Malayalam'), (u'mn', u'Mongolian'), (u'mr', u'Marathi'), (u'my', u'Burmese'), (u'nb', u'Norwegian Bokm\xe5l'), (u'ne', u'Nepali'), (u'nl', u'Dutch'), (u'nn', u'Norwegian Nynorsk'), (u'os', u'Ossetic'), (u'pa', u'Punjabi'), (u'pl', u'Polish'), (u'pt', u'Portuguese'), (u'pt-br', u'Brazilian Portuguese'), (u'ro', u'Romanian'), (u'ru', u'Russian'), (u'sk', u'Slovak'), (u'sl', u'Slovenian'), (u'sq', u'Albanian'), (u'sr', u'Serbian'), (u'sr-latn', u'Serbian Latin'), (u'sv', u'Swedish'), (u'sw', u'Swahili'), (u'ta', u'Tamil'), (u'te', u'Telugu'), (u'th', u'Thai'), (u'tr', u'Turkish'), (u'tt', u'Tatar'), (u'udm', u'Udmurt'), (u'uk', u'Ukrainian'), (u'ur', u'Urdu'), (u'vi', u'Vietnamese'), (u'zh-hans', u'Simplified Chinese'), (u'zh-hant', u'Traditional Chinese')] LANGUAGES_BIDI | [u'he', u'ar', u'fa', u'ur'] LANGUAGE_CODE | 'en-us' LANGUAGE_COOKIE_AGE | None LANGUAGE_COOKIE_DOMAIN | None LANGUAGE_COOKIE_NAME | u'django_language' LANGUAGE_COOKIE_PATH | u'/' LDAP_BASE_PASS | u'********************' LDAP_BASE_USER | '' LDAP_PORT | 389 LDAP_SEARCH_BASE | '' LDAP_SERVER | '' LDAP_URI | None LDAP_USER_DN_TEMPLATE | None LDAP_USER_QUERY | '' LDAP_USE_TLS | False LEGEND_MAX_ITEMS | 10 LOCALE_PATHS | [] LOGGING | {} LOGGING_CONFIG | u'logging.config.dictConfig' LOGIN_REDIRECT_URL | u'/accounts/profile/' LOGIN_URL | u'/account/login' LOGOUT_REDIRECT_URL | None LOG_CACHE_PERFORMANCE | False LOG_DIR | '/opt/graphite/storage/log/webapp' LOG_FILE_CACHE | 'cache.log' LOG_FILE_EXCEPTION | 'exception.log' LOG_FILE_INFO | 'info.log' LOG_FILE_RENDERING | 'rendering.log' LOG_RENDERING_PERFORMANCE | False LOG_ROTATION | True LOG_ROTATION_COUNT | 1 MANAGERS | [] MAX_FETCH_RETRIES | 2 MAX_TAG_LENGTH | 50 MEDIA_ROOT | '' MEDIA_URL | '' MEMCACHE_HOSTS | [] MEMCACHE_KEY_PREFIX | u'********************' MEMCACHE_OPTIONS | {} MESSAGE_STORAGE | u'django.contrib.messages.storage.fallback.FallbackStorage' METRICS_FIND_FAILURE_THRESHOLD | inf METRICS_FIND_WARNING_THRESHOLD | inf MIDDLEWARE | ('graphite.middleware.LogExceptionsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.gzip.GZipMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') MIDDLEWARE_CLASSES | [u'django.middleware.common.CommonMiddleware', u'django.middleware.csrf.CsrfViewMiddleware'] MIGRATION_MODULES | {} MONTH_DAY_FORMAT | u'F j' NUMBER_GROUPING | 0 PASSWORD_HASHERS | u'********************' PASSWORD_RESET_TIMEOUT_DAYS | u'********************' POOL_MAX_WORKERS | 10 PREPEND_WWW | False REMOTE_BUFFER_SIZE | 1048576 REMOTE_EXCLUDE_LOCAL | False REMOTE_FETCH_TIMEOUT | None REMOTE_FIND_TIMEOUT | None REMOTE_RENDERING | False REMOTE_RENDER_CONNECT_TIMEOUT | 1.0 REMOTE_RETRY_DELAY | 60.0 REMOTE_STORE_FORWARD_HEADERS | [] REMOTE_STORE_MERGE_RESULTS | True REMOTE_STORE_USE_POST | False REMOTE_USER_BACKEND | '' REMOTE_USER_MIDDLEWARE | '' RENDERING_HOSTS | [] REPLICATION_FACTOR | 1 ROOT_URLCONF | 'graphite.urls' RRD_CF | 'AVERAGE' RRD_DIR | '/opt/graphite/storage/rrd/' SECRET_KEY | u'********************' SECURE_BROWSER_XSS_FILTER | False SECURE_CONTENT_TYPE_NOSNIFF | False SECURE_HSTS_INCLUDE_SUBDOMAINS | False SECURE_HSTS_PRELOAD | False SECURE_HSTS_SECONDS | 0 SECURE_PROXY_SSL_HEADER | None SECURE_REDIRECT_EXEMPT | [] SECURE_SSL_HOST | None SECURE_SSL_REDIRECT | False SERVER_EMAIL | u'root@localhost' SESSION_CACHE_ALIAS | u'default' SESSION_COOKIE_AGE | 1209600 SESSION_COOKIE_DOMAIN | None SESSION_COOKIE_HTTPONLY | True SESSION_COOKIE_NAME | u'sessionid' SESSION_COOKIE_PATH | u'/' SESSION_COOKIE_SECURE | False SESSION_ENGINE | u'django.contrib.sessions.backends.db' SESSION_EXPIRE_AT_BROWSER_CLOSE | False SESSION_FILE_PATH | None SESSION_SAVE_EVERY_REQUEST | False SESSION_SERIALIZER | u'django.contrib.sessions.serializers.JSONSerializer' SETTINGS_MODULE | 'graphite.settings' SHORT_DATETIME_FORMAT | u'm/d/Y P' SHORT_DATE_FORMAT | u'm/d/Y' SIGNING_BACKEND | u'django.core.signing.TimestampSigner' SILENCED_SYSTEM_CHECKS | ['urls.W002'] SMTP_SERVER | 'localhost' STANDARD_DIRS | ['/opt/graphite/storage/whisper/'] STATICFILES_DIRS | ('/opt/graphite/webapp/content',) STATICFILES_FINDERS | [u'django.contrib.staticfiles.finders.FileSystemFinder', u'django.contrib.staticfiles.finders.AppDirectoriesFinder'] STATICFILES_STORAGE | u'django.contrib.staticfiles.storage.StaticFilesStorage' STATIC_ROOT | '/opt/graphite/static' STATIC_URL | '/static/' STORAGE_DIR | '/opt/graphite/storage' STORAGE_FINDERS | ('graphite.finders.remote.RemoteFinder', 'graphite.finders.standard.StandardFinder') TAGDB | 'graphite.tags.localdatabase.LocalDatabaseTagDB' TAGDB_AUTOCOMPLETE_LIMIT | 100 TAGDB_CACHE_DURATION | 60 TAGDB_HTTP_AUTOCOMPLETE | False TAGDB_HTTP_PASSWORD | u'********************' TAGDB_HTTP_URL | '' TAGDB_HTTP_USER | '' TAGDB_REDIS_DB | 0 TAGDB_REDIS_HOST | 'localhost' TAGDB_REDIS_PORT | 6379 TEMPLATES | [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/opt/graphite/webapp/graphite/templates'], 'OPTIONS': {'context_processors': ['django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages']}}] TEMPLATE_DEBUG | False TEST_NON_SERIALIZED_APPS | [] TEST_RUNNER | u'django.test.runner.DiscoverRunner' THOUSAND_SEPARATOR | u',' TIME_FORMAT | u'P' TIME_INPUT_FORMATS | [u'%H:%M:%S', u'%H:%M:%S.%f', u'%H:%M'] TIME_ZONE | 'America/Chicago' URL_PREFIX | '' USE_ETAGS | False USE_I18N | True USE_L10N | False USE_LDAP_AUTH | False USE_REMOTE_USER_AUTHENTICATION | False USE_THOUSAND_SEPARATOR | False USE_TZ | True USE_WORKER_POOL | True USE_X_FORWARDED_HOST | False USE_X_FORWARDED_PORT | False WEBAPP_DIR | '/opt/graphite/webapp' WEBAPP_VERSION | '1.1.3' WEB_DIR | '/opt/graphite/webapp/graphite' WHISPER_DIR | '/opt/graphite/storage/whisper/' WHITELIST_FILE | '/opt/graphite/storage/lists/whitelist' WSGI_APPLICATION | None X_FRAME_OPTIONS | u'SAMEORIGIN' YEAR_MONTH_FORMAT | u'F Y' — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/graphite-project/graphite-web/issues/2393>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABK51pLtBEVZDUC4elawsYLh4nVO7nnLks5u3gO3gaJpZM4ZKwPR> .
hmm - it looks like this as shown above:
-rwxrwxr-x 1 www-data www-data 311296 Dec 9 21:34 graphite.db
www-data
is the apache user on Raspbian (Debian for Raspberry Pi). Does the directory need these settings also?
Thank you, Chris.
-rwxrwxr-x 1 graphite www-data
311296 Dec 9 21:34 /opt/graphite/storage/graphite.db
-rwxrwxr-x 1 www-data graphite
311296 Dec 9 21:34 /opt/graphite/storage/graphite.db
ran systemctl restart apache2
after each change (just in case) but same issue...
Probably. It’s a generic Linux, so read and execute rights for directories should be propagated. Check directory attributes and inheritance in https://wiki.archlinux.org/index.php/File_permissions_and_attributes E.g. if file is located in /opt/graphite/storage, /opt and /opt/graphite can be owned by root and should have r-x for others (usually it has by default), /opt/graphite/storage can be owned by graphite user and www-data group and should have rwxrwxr-x permission
On Mon, 10 Dec 2018 at 08:11, Chris Jefferies notifications@github.com wrote:
hmm - it looks like this as shown above: -rwxrwxr-x 1 www-data www-data 311296 Dec 9 21:34 graphite.db
www-data is the apache user on Raspbian (Debian for Raspberry Pi). Does the directory need these settings also?
Thank you, Chris.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/graphite-project/graphite-web/issues/2393#issuecomment-445709528, or mute the thread https://github.com/notifications/unsubscribe-auth/ABK51hqiSpnGHipWr2lYgN93JT0D-Szsks5u3gkKgaJpZM4ZKwPR .
Oh! Oh! Almost there...
the storage dir:
drwxrwxr-x 7 graphite www-data 4096 Dec 9 23:27 storage
The data file:
-rwxrwxr-x 1 graphite www-data 311296 Dec 10 01:45 /opt/graphite/storage/graphite.db
Now I see the header of the graphite web page, but not the rest. I think this is the most tenacious install I've ever tried... ;)
Any thoughts on the problem of seeing only the header but not the list of whisper databases and the default chart?
Looking at the graphite log, I see a dozen or so entries using this:
# tail -f /opt/graphite/storage/log/webapp/error.log
client denied by server configuration: /opt/graphite/static, referer: http://tinaja-gr:8080/composer?
I'm not sure about the reference to composer; I'm using the URL: http://tinaja-gr:8080
Apache should be configured to serve these files. Please check example config in https://graphite.readthedocs.io/en/latest/config-webapp.html
On Mon, 10 Dec 2018 at 08:57, Chris Jefferies notifications@github.com wrote:
Looking at the graphite log, I see a dozen or so entries using this:
tail -f /opt/graphite/storage/log/webapp/error.log
client denied by server configuration: /opt/graphite/static, referer: http://tinaja-gr:8080/composer?
I'm not sure about the reference to composer; I'm using the URL: http://tinaja-gr:8080
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/graphite-project/graphite-web/issues/2393#issuecomment-445723518, or mute the thread https://github.com/notifications/unsubscribe-auth/ABK51tslznvMYxtoPTnHKTQ-apqY3nCTks5u3hPXgaJpZM4ZKwPR .
OK. Excellent. I see the section on WSGIScriptAlias
in the example I have is all commented out.
# WSGIScriptAlias /graphite /srv/graphite-web/conf/graphite.wsgi/graphite
# Alias /graphite/static /opt/graphite/webapp/content
# <Location "/graphite/static/">
# SetHandler None
# </Location>
I'll rework that and see how it goes.
Thank you, Chris
FINALLY!
The static attributes required that I run this:
PYTHONPATH=/opt/graphite/webapp django-admin.py collectstatic --noinput --settings=graphite.settings
My current vhost file:
# /etc/httpd/conf.d/graphite-vhost.conf
LoadModule wsgi_module "/usr/lib/apache2/modules/mod_wsgi-py27.so"
WSGISocketPrefix /var/run/wsgi
Listen 8080
<VirtualHost *:8080>
ServerName graphite
DocumentRoot "/opt/graphite/webapp"
ErrorLog /opt/graphite/storage/log/webapp/error.log
CustomLog /opt/graphite/storage/log/webapp/access.log common
WSGIDaemonProcess graphite-web processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
WSGIProcessGroup graphite-web
WSGIApplicationGroup %{GLOBAL}
WSGIImportScript /opt/graphite/conf/graphite.wsgi process-group=graphite-web application-group=%{GLOBAL}
WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi
Alias /static/ /opt/graphite/static/
<Directory /opt/graphite/static/>
<IfVersion < 2.4>
Order deny,allow
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
<Directory /opt/graphite/conf/>
<IfVersion < 2.4>
Order deny,allow
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
Thank you, @deniszh , for helping me over the finish line...
I'm trying to create a repeatable install with Ansible. None of the existing Ansible modules (roles) work in my environment so integrating various pieces. The end game is to collect metrics and get them into Grafana.
Most of it has come together - I have Apache working with mod_wsgi 4.6.5, Carbon is receiving metrics and storing it in Whisper, Grafana launches beautifully... but can't get past this database error. This one is killin' me.
Any tips mercifully appreciated. Thanks.
Using:
Configured in debug mode (set in opt/graphite/webapp/graphite/local_settings.py):
The database layout in local_settings.py
Stack trace:
Graphite.settings: