** Changed in: horizon/folsom
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1067206

Title:
  Server error pages are broken

Status in OpenStack Dashboard (Horizon):
  Fix Released
Status in OpenStack Dashboard (Horizon) folsom series:
  Fix Released

Bug description:
  When an unhandled exception occurs with DEBUG=False,
  openstack_dashboard tries to render the 500.html template but fails
  because it inherits the base.html template, which then includes
  _conf.html, which expects the STATIC_URL context variable to be
  present. 500 errors are a special case in Django because they are
  passed an empty Context rather than the usual RequestContext[1].

  This results in a somewhat cryptic compressor error:

  [Tue Oct 16 00:30:39 2012] [error] [client 128.250.116.167]
  UncompressableFileError: 'horizon/js/horizon.js' isn't accessible via
  COMPRESS_URL ('/static/') and can't be compressed

  ...which you can eventually trace back to this line in
  horizon/_conf.html:

  <script src='{{ STATIC_URL }}horizon/js/horizon.js'
  type='text/javascript' charset='utf-8'></script>

  ...where STATIC_URL evaluates to an empty string.

  From a discussion[2] on the Django dev list it looks like there are a
  few options:

  1) Make the error page simpler (i.e., don't inherit base.html)
  2) Replace use of STATIC_URL with the staticfiles 'static' templatetag[3]. 
There may be other context variables in templates that are still missing though.
  3) Override the handler and pass in the RequestContext anyway (this is 
exactly what Django is attempting to avoid, since any errors in generating the 
context will break your error page).

  I think (1) is reasonable and low maintenance. What do you think?


  [1] 
https://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view
  [2] 
https://groups.google.com/forum/#!topic/django-developers/UH8ehYL8Pss/discussion
  [3] https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#static

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1067206/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to