Issue if public and internal endpoints are different
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Incomplete
|
Medium
|
Deliang Fan |
Bug Description
We have a setup where our service public endpoints are HTTPS (to a host running Apache Traffic Server which then maps the request to use HTTP to the actual service) while the internal and admin endpoints are HTTP that should never be used off the Openstack hosts.
The problem is that make_url in util.py (https:/
We're seeing this in Icehouse and it doesn't looks like the code has changed in Juno.
We're currently doing a local patch to fix this (below is the exact code that we're currently using for make_url). We'd like to...
1. Fix this in a less hacky way if possible.
2. Get the fix into the upstream code base in case other folks have different URLs for public and internal endpoints *and* allow us to get rid of a local patch.
I'm happy to work on the fix for this. Just let me know how you'd would prefer to go about it.
Thanks,
Ken
def make_url(req, identity):
'''Return the URL for the supplied identity dictionary.'''
try:
except ValueError:
err_reason = _('Invalid Stack address')
raise exc.HTTPInterna
########### BEGIN PATCH
# See if we can get the public endpoint from the service catalog
# in the headers. Yes, we could try to put it into the request context
# but we're going to process it per request, and if we put it there
# (1) We'd process it for every request and not just the ones that
# need it.
# (2) It would complicate this patch by spreading it across multiple
# files
# If we can't get the service catalog or find the public endpoint for
# heat, then use the old logic.
try:
sc = json_loads(
if sc:
# Walk through the entries and look for the 'heat' info
for entry in sc:
if entry.get('name') == 'heat':
except Exception, ex:
# This is okay. It just means that we had a problem getting the
# service catalog. We'll just ignore it and use the pre-patch code
########### END PATCH
return req.relative_
Changed in heat: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in heat: | |
status: | Triaged → Confirmed |
assignee: | nobody → Deliang Fan (vanderliang) |
Changed in heat: | |
status: | Confirmed → In Progress |
Changed in heat: | |
milestone: | none → no-priority-tag-bugs |
We have a similar set up.
Would this bug be the reason we are seeing the following in horizon?
2015-04-01 08:16:39,837 8800 ERROR django.request Internal Server Error: /dashboard/ project/ stacks/ python2. 6/site- packages/ django/ core/handlers/ base.py" , line 109, in get_response python2. 6/site- packages/ horizon/ decorators. py", line 38, in dec python2. 6/site- packages/ horizon/ decorators. py", line 54, in dec python2. 6/site- packages/ horizon/ decorators. py", line 38, in dec python2. 6/site- packages/ horizon/ decorators. py", line 86, in dec python2. 6/site- packages/ django/ views/generic/ base.py" , line 48, in view request, *args, **kwargs) python2. 6/site- packages/ django/ views/generic/ base.py" , line 69, in dispatch python2. 6/site- packages/ horizon/ tables/ views.py" , line 162, in post python2. 6/site- packages/ horizon/ tables/ views.py" , line 154, in get tables( ) python2. 6/site- packages/ horizon/ tables/ views.py" , line 145, in construct_tables table(table) python2. 6/site- packages/ horizon/ tables/ views.py" , line 121, in handle_table name].maybe_ handle( ) python2. 6/site- packages/ horizon/ tables/ base.py" , line 1480, in maybe_handle action( action_ name, obj_id) python2. 6/site- packages/ horizon/ tables/ base.py" , line 1326, in take_action multiple( self, self.request, obj_ids) python2. 6/site- packages/ horizon/ tables/ actions. py", line 294, in multiple data_table, request, object_ids) python2. 6/site- packages/ horizon/ tables/ actions. py", line 665, in handle handle( request, ignore=ignore) python2. 6/site- packages/ horizon/ tables/ actions. py", line 649, in handle action( request, datum_id) openstack- dashboard/ openstack_ dashboard/ wsgi/.. /../openstack_ dashboard/ dashboards/ project/ stacks/ tables. py", line 57, in action heat.stack_ delete( request, stack_id) openstack- dashboard/ openstack_ dashboard/ wsgi/.. /../openstack_ dashboard/ api/heat. py", line 60, in stack_delete request) .stacks. delete( stack_id) python2. 6/site- packages/ heatclient/ v1/stacks. py", line 131, in delete _delete( "/stacks/ %s" % stack_id) python2. 6/site- packages/ heatclient/ openstack/ common/ apiclient/ base.py" , line 202, in _delete delete( url) python2. 6/site- packages/ heatclient/ common/ http.py" , line 289, in delete request( "DELETE" , url, ...
Traceback (most recent call last):
File "/usr/lib/
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/
return view_func(request, *args, **kwargs)
File "/usr/lib/
return view_func(request, *args, **kwargs)
File "/usr/lib/
return view_func(request, *args, **kwargs)
File "/usr/lib/
return view_func(request, *args, **kwargs)
File "/usr/lib/
return self.dispatch(
File "/usr/lib/
return handler(request, *args, **kwargs)
File "/usr/lib/
return self.get(request, *args, **kwargs)
File "/usr/lib/
handled = self.construct_
File "/usr/lib/
handled = self.handle_
File "/usr/lib/
handled = self._tables[
File "/usr/lib/
return self.take_
File "/usr/lib/
response = action.
File "/usr/lib/
return self.handle(
File "/usr/lib/
exceptions.
File "/usr/lib/
self.
File "/usr/share/
api.
File "/usr/share/
return heatclient(
File "/usr/lib/
self.
File "/usr/lib/
return self.client.
File "/usr/lib/
return self.raw_