Jets deploy error : APIGateway Switching Region


#1

I started seeing this recently on jets deploy. wonder if anyone else is seeing the same?

Building CloudFormation templates.
Traceback (most recent call last):
	39: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/bin/jets:23:in `<main>'
	38: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/bin/jets:23:in `load'
	37: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/exe/jets:14:in `<top (required)>'
	36: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/cli.rb:5:in `start'
	35: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/cli.rb:21:in `start'
	34: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/commands/base.rb:27:in `perform'
	33: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/commands/base.rb:38:in `dispatch'
	32: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	31: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	30: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	29: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/commands/main.rb:21:in `deploy'
	28: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/commands/deploy.rb:34:in `run'
	27: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/commands/deploy.rb:80:in `ship'
	26: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/commands/build.rb:34:in `build_templates'
	25: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/commands/build.rb:44:in `build_all_templates'
	24: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/commands/build.rb:58:in `build_api_gateway_templates'
	23: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/cfn/builders/interface.rb:13:in `build'
	22: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/cfn/builders/api_gateway_builder.rb:15:in `compose'
	21: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/cfn/builders/api_gateway_builder.rb:33:in `add_gateway_rest_api'
	20: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/cfn/builders/interface.rb:86:in `add_resource'
	19: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/base.rb:16:in `logical_id'
	18: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/memoist-0.16.0/lib/memoist.rb:170:in `resource'
	17: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/base.rb:20:in `resource'
	16: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/api_gateway/rest_api.rb:15:in `definition'
	15: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/api_gateway/rest_api.rb:23:in `internal_logical_id'
	14: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/api_gateway/rest_api.rb:27:in `logical_id'
	13: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/api_gateway/rest_api.rb:32:in `internal_logical_id'
	12: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/api_gateway/rest_api/logical_id.rb:9:in `get'
	11: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/api_gateway/rest_api/logical_id.rb:18:in `changed?'
	10: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/api_gateway/rest_api/change_detection.rb:8:in `changed?'
	 9: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/memoist-0.16.0/lib/memoist.rb:170:in `current_binary_media_types'
	 8: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/jets-1.8.14/lib/jets/resource/api_gateway/rest_api/change_detection.rb:29:in `current_binary_media_types'
	 7: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-apigateway-1.28.0/lib/aws-sdk-apigateway/client.rb:3612:in `get_rest_api'
	 6: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.52.1/lib/seahorse/client/request.rb:70:in `send_request'
	 5: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.52.1/lib/seahorse/client/plugins/response_target.rb:23:in `call'
	 4: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.52.1/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
	 3: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.52.1/lib/aws-sdk-core/plugins/param_converter.rb:24:in `call'
	 2: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.52.1/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in `call'
	 1: from /Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.52.1/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
/Users/thusharawijeratna/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.52.1/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call': Invalid API identifier specified 231904212587:xcx0xd8m4d (Aws::APIGateway::Errors::NotFoundException)

It seems to be hitting an error in trying to create the API Gateway. It works if the Gateway exists -> I was trying to move the stack to a different region and saw this.


#2

Think moving region all in a single command does not work. Try:

jets delete # configure AWS_PROFILE to the old region
jets deploy # configure AWS_PROFILE to the new region

So try to move regions in 2 separate steps.


#3

Thanks - I manually deleted the cloudformation stack and it worked after.
Super impressed with Jets - Iā€™m evaluating latency now.

Have you seen this: https://theburningmonk.com/2018/01/im-afraid-youre-thinking-about-aws-lambda-cold-starts-all-wrong/

Any thoughts on the cold start problem?


#4

There are some thoughts on cold starts in this presentation at Ruby Kaigi in Japan: Jets Ruby Serverless Framework