STATIC_URL is missing in context if ALLOWED_HOSTS not set.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
horizon (Ubuntu) |
Fix Released
|
Critical
|
Unassigned | ||
Saucy |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Dashboard in Saucy is unusable with Ubuntu theme installed. Traceback of the problem:
Traceback (most recent call last):
File "/usr/lib/
response = self.get_
File "/usr/lib/
response = self.handle_
File "/usr/lib/
return callback(request, **param_dict)
File "/usr/lib/
response = view_func(request, *args, **kwargs)
File "/usr/lib/
return http.HttpRespon
File "/usr/lib/
return self._render(
File "/usr/lib/
return self.nodelist.
File "/usr/lib/
bit = self.render_
File "/usr/lib/
return node.render(
File "/usr/lib/
return compiled_
File "/usr/lib/
return self.nodelist.
File "/usr/lib/
bit = self.render_
File "/usr/lib/
return node.render(
File "/usr/lib/
return self.render_
File "/usr/lib/
output = template.
File "/usr/lib/
return self._render(
File "/usr/lib/
return self.nodelist.
File "/usr/lib/
bit = self.render_
File "/usr/lib/
return node.render(
File "/usr/lib/
return self.render_
File "/usr/lib/
cache_key, cache_content = self.render_
File "/usr/lib/
cache_key = get_templatetag
File "/usr/lib/
"templateta
File "/usr/lib/
value = obj.__dict_
File "/usr/lib/
[self.content] + self.mtimes)
File "/usr/lib/
value = obj.__dict_
File "/usr/lib/
for kind, value, basename, elem in self.split_
File "/usr/lib/
basename = self.get_
File "/usr/lib/
"compressed" % (url, base_url))
UncompressableF
It looks like this behavior is caused by python-
https:/
the error goes away. Considering these changes haven't been upstreamed in django-compressor, maybe a better approach would be to fix theme for the dashboard.
Related branches
- Ubuntu Server Developers: Pending requested
-
Diff: 139 lines (+63/-10)5 files modifieddebian/changelog (+15/-0)
debian/openstack-dashboard.conf (+2/-1)
debian/openstack-dashboard.postinst (+15/-1)
debian/openstack-dashboard.postrm (+9/-0)
debian/patches/ubuntu_local_settings.patch (+22/-8)
description: | updated |
Changed in horizon (Ubuntu Saucy): | |
status: | New → Confirmed |
Changed in horizon (Ubuntu Saucy): | |
status: | Confirmed → Triaged |
importance: | Undecided → High |
importance: | High → Critical |
First, it looks like the traceback in the original report is using a different configuration than the default we ship. We ship with COMPRESS_OFFLINE = True, but by the looks of the traceback it was enabled. Would be interested in the configs used there.
That said, the default saucy package we're shipping atm is definitely broken. The ubuntu theme, however, is not culprit. It is "good" although the theme itself could use a general refresh for Havana.
Installing it currently requires working around Bug #1218535 and Bug #1216019.
After installed and enabled and making the minimal config in /etc/openstack- dashboard/ local_settings. py to point to my keystone server, the dashboard is expected to function. However, I get a 500 and compression exception in apache error log:
OfflineGenerati onError: You have offline compression enabled but key "3ddd89d27fa2e1 62d4efd30c103a0 72b" is missing from offline manifest. You may need to run "python manage.py compress".
This would typically mean the pre-compressed JS and CSS we ship with the package are outdated but in this case django. core.base: BaseHandler is catching and masking a SuspiciousOperation exception (Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS) and continuing to process the request. As far as I can tell (as a django novice), this is causing templates to later be rendered with empty/incomplete contexts that lack STATIC_URL, and messing with the hashing algorithm used by compressor to map requested URLs to the compressed files, which results in the OfflineGenerati onError / key error.
As a work around in the meantime, adding ALLOWED_HOSTS = '*' to /etc/openstack- dashboard/ local_settings. py should resolve it.
We either need to find a sane default for ALLOWED_HOSTS or help fix horizon so such errors cause fast failures.