I am getting a 500 when i am trying to create a new credential with a single key that contains a multiline value:
Logs says the POST to save the credentials returns 200 OK. The subsequent GET returns 500. (See logs below).
If i create the credential containing a key and a single line value and later update it with a multiline value, it works as expected.
confidant_1 | 172.17.42.1 - - [06/Nov/2015:16:17:24 +0000] "POST /v1/credentials HTTP/1.1" 200 265 "http://localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0"
confidant_1 | 172.17.42.1 - - [06/Nov/2015:16:17:25 +0000] "GET /v1/credentials HTTP/1.1" 200 4246 "http://localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0"
confidant_1 | 172.17.42.1 - - [06/Nov/2015:16:17:25 +0000] "GET /v1/credentials/ea5cb10c685c4aa7b6030bb983d80b47/services HTTP/1.1" 200 20 "http://localhost/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0"
confidant_1 | [2015-11-06 16:17:25 +0000] [10] [ERROR] Error handling request
confidant_1 | Traceback (most recent call last):
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 52, in handle
confidant_1 | self.handle_request(listener_name, req, client, addr)
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 159, in handle_request
confidant_1 | super(GeventWorker, self).handle_request(*args)
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 105, in handle_request
confidant_1 | respiter = self.wsgi(environ, resp.start_response)
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
confidant_1 | return self.wsgi_app(environ, start_response)
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/guard.py", line 62, in __call__
confidant_1 | return self.application(environ, _start_response)
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
confidant_1 | response = self.make_response(self.handle_exception(e))
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
confidant_1 | reraise(exc_type, exc_value, tb)
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
confidant_1 | response = self.full_dispatch_request()
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
confidant_1 | rv = self.handle_user_exception(e)
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
confidant_1 | reraise(exc_type, exc_value, tb)
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
confidant_1 | rv = self.dispatch_request()
confidant_1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
confidant_1 | return self.view_functions[rule.endpoint](**req.view_args)
confidant_1 | File "/srv/confidant/confidant/authnz.py", line 109, in decorated
confidant_1 | return f(*args, **kwargs)
confidant_1 | File "/srv/confidant/confidant/routes/v1.py", line 312, in get_credential
confidant_1 | _credential_pairs = json.loads(_credential_pairs)
confidant_1 | File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
confidant_1 | return _default_decoder.decode(s)
confidant_1 | File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
confidant_1 | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
confidant_1 | File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
confidant_1 | obj, end = self.scan_once(s, idx)
confidant_1 | ValueError: Invalid control character at: line 1 column 16 (char 15)
confidant_1 | 172.17.42.1 - - [06/Nov/2015:16:17:25 +0000] "GET /v1/credentials/ea5cb10c685c4aa7b6030bb983d80b47 HTTP/1.1" 500 - "-" "-"