-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No graphite composer #1173
Comments
Anyone can help me? Very strange problem. |
@sglwlb which version of Django have you got installed? I've run into the same problem after upgrading the Django14 rpm from version 1.4.14-1.el6 to 1.4.18-1.el6. Downgrading again fixed it for me. So far I've not check what happened and which package might be at fault... |
@fferner Yeah, you are right, i also downgrading the Django14 to fix this problem. But now EPEL has updated the Django14 to the 1.4.18-1.el6, and the graphite-web on the EPEL became incompatible of the Django, that's not good. Hope graphite-web will update also. |
@sglwlb FWIW, I've reported this issue as a bug to fedora-epel: https://bugzilla.redhat.com/show_bug.cgi?id=1199126 |
@fferner Ah, cool, look forward some one will fix it, -:) |
It looks like Django decided it will not serve static files, unless in debug mode or insecure mode. See --insecure documention and stackoverflow for more information. More specifically, the problem is that staticfiles_urlpatterns in graphite.urls is not returning the appropriate regex, unless either of these modes are set. |
This doesn't sound like a RHEL/EPEL bug to me, but a side-effect of upstream policy changes by Django. I'm not familiar with the EPEL package; do they rely on the development |
As far as I can tell, it looks like this has always been the way Django behaved. I'm not actually sure why downgrading Django would have fixed this for the above users, though. When I manually install older Django releases(outside of a package manager), I still see this behavior. It also might be worth noting that graphite didn't always use django.contrib.staticfiles, which is what causes this behavior. That seems to have been started in 1e1de1. |
@obfuscurity I'm running with Apache 2.2.15-39/WSGI 3.2-7 and Django 1.4.18 and am experiencing the same issue. |
Static files are served We could probably serve static files directly in the graphite webapp, using something like whitenoise (probably needs more work than what's in the quickstart docs, though). |
Additionally, my installation is requesting the js and css from /content (i.e. /content/js/composer.js) and it's getting "200" responses, the content is just empty. However, the files do exist at /opt/graphite/webapp/content and permissions all appear to be fine. BTW, running graphite 0.9.12 installed via PIP. |
@sglwlb I had the same problem. The apache site configuration was missing an alias for the content directory. |
@azikic can you share your entire graphite-web.conf vhost file? |
@yoavp77 I am using centos 6.5 with the graphite-web package from EPEL. This is the default configuration file with the added alias configuration:
|
@azikic awesome! that's all I was missing to get it to work, also with graphite-web installed from EPEL (centos 6.2) |
@azikic thanks. Your fix couldn't have been more appropriately timed, since I've just encountered the same issue. |
@azikic Cool! Just upgrade the Django and try your fix, it works, thanks very much! |
i can confirm that adding that line to
|
There is a fix in master: static files are served by the webapp directly, no need to make an alias or anything. Note that whitenoise must be installed as a new dependency. The patch should be easy to port to 0.9.x if needed. |
@brutasse, I am seeing the same problem on 0.10.0-alpha. How do you get rid of these errors? |
@gsaray101 do you have |
@brutasse, yes. I have installed whitenoise-1.0.6 and I also put this in wsgi.py file: from django.core.wsgi import get_wsgi_application application = get_wsgi_application() I keep getting this error also in apache log, my secret key is already set: [Thu May 28 09:41:24 2015] [error] /opt/graphite/webapp/graphite/settings.py:233: UserWarning: SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security |
Just using graphite-web/webapp/graphite/wsgi.py Lines 21 to 29 in 1db428c
If you have the secret_key warning, it means your |
I compilted mod_wsgi my wsgi.conf file under apache:/etc/apache2/conf.d looks like this: LoadModule wsgi_module /usr/lib64/apache2/mod_wsgi.so I do see the module when I do /usr/sbin/http2 -M But I dont see this directory: /usr/local/lib64/python2.6/site-packages/mod_wsgi-4.3.1-py2.6-linux-x86_64.egg/ WSGIPythonPath /usr/local/lib64/python2.6/site-packages does not seem to exists. Do I need this? Do you think this is the problem |
I've installed your wsgi.py, no change. I still get static errors on browser. |
@brutasse , I really need help with this. I really dont know what is going on at this point. I do see this message in apache error: [Thu May 28 10:42:34 2015] [notice] Apache/2.2.12 (Linux/SUSE) mod_wsgi/4.3.0 Python/2.6.9 mod_ssl/2.2.12 OpenSSL/0.9.8j-fips configured -- resuming normal operations Which means that mod_wsgi should be ok. Any ideas what I may be missing? |
If I remember correctly this error happening if mod_wsgi and python versions are different (e.g 2.6 vs 2.7 or 2.7 vs 3.x) |
I install the graphite-web and config it, after that, i access it from browser, there is no "graphite composer". I use develop tool to catch the problem, the errors are:
Uncaught ReferenceError: Ext is not defined
(index):91 Uncaught ReferenceError: Ext is not defined
(index):101 Uncaught ReferenceError: GraphiteBrowser is not defined
but, the Ext and GraphiteBroser are all there.
And, i found the response body length is zero, like follow:
Remote Address:[::1]:9999
Request URL:http://localhost:9999/content/js/ext/resources/css/ext-all.css
Request Method:GET
Status Code:200 OK (from cache)
Request Headers
Provisional headers are shown
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36
Response Headers
Access-Control-Allow-Headers:origin, authorization, accept
Access-Control-Allow-Methods:GET, OPTIONS
Access-Control-Allow-Origin:*
Connection:close
Content-Length:0
Content-Type:text/css
Date:Fri, 27 Feb 2015 02:03:20 GMT
Last-Modified:Wed, 21 Aug 2013 17:11:04 GMT
Server:Apache/2.2.15 (CentOS)
Vary:Accept-Encoding
Follow are the error message when i config the database, is it relate to this problem?
/etc/graphite-web/local_settings.py.back
/usr/lib/python2.6/site-packages/graphite/settings.py:231: 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')
/usr/lib/python2.6/site-packages/django/conf/init.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
"use STATIC_URL instead.", DeprecationWarning)
/usr/lib/python2.6/site-packages/django/core/cache/init.py:82: DeprecationWarning: settings.CACHE_* is deprecated; use settings.CACHES instead.
DeprecationWarning
Creating tables ...
Creating table account_profile
Creating table account_variable
Creating table account_view
Creating table account_window
Creating table account_mygraph
Creating table dashboard_dashboard_owners
Creating table dashboard_dashboard
Creating table events_event
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_session
Creating table django_admin_log
Creating table django_content_type
Creating table tagging_tag
Creating table tagging_taggeditem
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/graphite/manage.py", line 13, in
execute_from_command_line(sys.argv)
File "/usr/lib/python2.6/site-packages/django/core/management/init.py", line 443, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.6/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(_args, *_options.dict)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, _options)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(_options)
File "/usr/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/usr/lib/python2.6/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal
interactive=interactive, db=db)
File "/usr/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, *_named)
File "/usr/lib/python2.6/site-packages/django/contrib/auth/management/init.py", line 73, in create_superuser
call_command("createsuperuser", interactive=True, database=db)
File "/usr/lib/python2.6/site-packages/django/core/management/init.py", line 150, in call_command
return klass.execute(_args, *_defaults)
File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, *_options)
File "/usr/lib/python2.6/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle
default_username = get_default_username()
File "/usr/lib/python2.6/site-packages/django/contrib/auth/management/init.py", line 105, in get_default_username
default_username = get_system_username()
File "/usr/lib/python2.6/site-packages/django/contrib/auth/management/init.py", line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
File "/usr/lib64/python2.6/locale.py", line 478, in getdefaultlocale
return _parse_localename(localename)
File "/usr/lib64/python2.6/locale.py", line 410, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
The text was updated successfully, but these errors were encountered: