Невозможно выполнить «уничтожение терраформ» в локальном стеке - PullRequest
0 голосов
/ 23 октября 2019

после создания api_gateway в localstack с помощью terraform, я пытаюсь уничтожить его, но при запуске terraform destroy я застрял в

aws_api_gateway_deployment.api_deployment: Still destroying... [id=r2zycnye6q, 6m40s elapsed]

И в localalstack появилась эта ошибка

localstack_1  | 2019-10-23 05:33:05,261:API: Error on request:
localstack_1  | Traceback (most recent call last):
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/werkzeug/serving.py", line 304, in run_wsgi
localstack_1  |     execute(self.server.app)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/werkzeug/serving.py", line 292, in execute
localstack_1  |     application_iter = app(environ, start_response)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/server.py", line 132, in __call__
localstack_1  |     return backend_app(environ, start_response)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__
localstack_1  |     return self.wsgi_app(environ, start_response)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
localstack_1  |     response = self.handle_exception(e)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
localstack_1  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
localstack_1  |     reraise(exc_type, exc_value, tb)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
localstack_1  |     raise value
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
localstack_1  |     response = self.full_dispatch_request()
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
localstack_1  |     rv = self.handle_user_exception(e)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
localstack_1  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
localstack_1  |     reraise(exc_type, exc_value, tb)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
localstack_1  |     raise value
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
localstack_1  |     rv = self.dispatch_request()
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
localstack_1  |     return self.view_functions[rule.endpoint](**req.view_args)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/utils.py", line 140, in __call__
localstack_1  |     result = self.callback(request, request.url, {})
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/apigateway/responses.py", line 154, in stages
localstack_1  |     return 200, {}, json.dumps(stage_response)
localstack_1  | UnboundLocalError: local variable 'stage_response' referenced before assignment

И всякий раз, когда я хочу воссоздать экземпляр, я должен вручную удалить файл tfstate.

Если вы что-то знаете, пожалуйста, помогите мне

Большое спасибо.

...