zalando-stups / lizzy

REST Service to deploy AWS CloudFormation templates using Senza
Apache License 2.0
21 stars 17 forks source link

cannot create stacks with cdp32 lizzy version #235

Closed lerovitch closed 6 years ago

lerovitch commented 6 years ago

with version cdp32 we see the following issue:

Oct 25 14:19:05 ip-172-31-151-21 docker/3c0155008e47[834]:  INFO: Creating stack off-hours...
Oct 25 14:19:07 ip-172-31-151-21 docker/3c0155008e47[834]: UWSGI: GET /api/swagger.json -> 200
Oct 25 14:19:09 ip-172-31-151-21 docker/3c0155008e47[834]: UWSGI: GET /api/swagger.json -> 200
Oct 25 14:19:10 ip-172-31-151-21 docker/3c0155008e47[834]:  INFO: Stack created.
Oct 25 14:19:10 ip-172-31-151-21 docker/3c0155008e47[834]:      > stack_name: off-hours
Oct 25 14:19:10 ip-172-31-151-21 docker/3c0155008e47[834]:      > stack_version: rC1ff181dB40
Oct 25 14:19:10 ip-172-31-151-21 docker/3c0155008e47[834]:      > parameters: ['1ff181d']
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:  INFO: Refreshing access token "uid"..
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]: ERROR: Exception on /api/stacks [POST]
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:      > Traceback:   File "/app/.venv/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       response = self.full_dispatch_request()
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       rv = self.handle_user_exception(e)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       reraise(exc_type, exc_value, tb)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       raise value
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       rv = self.dispatch_request()
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       return self.view_functions[rule.endpoint](**req.view_args)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/connexion/decorators/decorator.py", line 73, in wrapper
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       response = function(request)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/connexion/decorators/security.py", line 155, in wrapper
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       return function(request)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/connexion/decorators/uri_parsing.py", line 117, in wrapper
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       response = function(request)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/connexion/decorators/validation.py", line 163, in wrapper
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       response = function(request)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/connexion/decorators/validation.py", line 336, in wrapper
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       return function(request)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/connexion/decorators/decorator.py", line 44, in wrapper
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       response = function(request)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/connexion/decorators/parameter.py", line 207, in wrapper
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       return function(**kwargs)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "<decorator-gen-6>", line 2, in create_stack
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "./lizzy/security.py", line 47, in bouncer
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       return endpoint(*args, **kwargs)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "<decorator-gen-5>", line 2, in create_stack
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "./lizzy/api.py", line 35, in exception_to_connexion_problem
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       return func(*args, **kwargs)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "./lizzy/api.py", line 144, in create_stack
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       running_time.finish()
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "./lizzy/metrics.py", line 43, in finish
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       push(self.key, running_time)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "./lizzy/metrics.py", line 18, in push
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       timeout=4)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/metricz/metricz.py", line 36, in __init__
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       self._renew_token()
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/metricz/metricz.py", line 49, in _renew_token
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       token = tokens.get('uid')
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/tokens/__init__.py", line 165, in get
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       refresh(token_name)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/tokens/__init__.py", line 147, in refresh
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       r.raise_for_status()
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                     File "/app/.venv/lib/python3.6/site-packages/requests/models.py", line 939, in raise_for_status
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:                       raise HTTPError(http_error_msg, response=self)
Oct 25 14:19:11 ip-172-31-151-21 docker/3c0155008e47[834]:      > Exception: 401 Client Error: Unauthorized for url: https://token.services.auth.zalando.com/oauth2/access_token?realm=/services
lerovitch commented 6 years ago

this was a client problem