Mistral doesn't handle a 400 response from keycloak

Bug #1740245 reported by noa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Triaged
Medium
Unassigned

Bug Description

when mistral is trying to validate a keycloak token, and gets a HTTP 400 response,
we get an exception in the log, when trying to process the response, and at the end return 500 due to that.

this is the segment from mistral API.log:
2017-12-27 08:24:49.372 28710 DEBUG requests.packages.urllib3.connectionpool [-] "GET /auth/realms/TestRealmA/protocol/openid-connect/userinfo HTTP/1.1" 400 72 _make_request /usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:401
2017-12-27 08:24:49.376 28710 INFO eventlet.wsgi.server [-] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/eventlet/wsgi.py", line 490, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 131, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/webob/dec.py", line 196, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/oslo_middleware/base.py", line 131, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1316, in send
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/site-packages/webob/request.py", line 1280, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/site-packages/pecan/middleware/recursive.py", line 56, in __call__
    return self.application(environ, start_response)
  File "/usr/lib/python2.7/site-packages/pecan/core.py", line 835, in __call__
    return super(Pecan, self).__call__(environ, start_response)
  File "/usr/lib/python2.7/site-packages/pecan/core.py", line 737, in __call__
    return state.response(environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/exc.py", line 359, in __call__
    app_iter = self.generate_response(environ, start_response)
  File "/usr/lib/python2.7/site-packages/webob/exc.py", line 349, in generate_response
    content_type=content_type,
  File "/usr/lib/python2.7/site-packages/webob/response.py", line 310, in __init__
    "You cannot set the body to a text value without a "
TypeError: You cannot set the body to a text value without a charset

Dougal Matthews (d0ugal)
Changed in mistral:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.