miasma-rb / miasma-aws

Miasma AWS API
Other
8 stars 8 forks source link

Failure when using AWS temporary credentials #47

Closed gramosbr closed 6 years ago

gramosbr commented 6 years ago

On the new v0.3.14

When using aws sts assume-role command Configuration becomes:

aws_sts_session_token aws_access_key_id aws_secret_access_key

bundle exec sfn list
ERROR: TypeError: no implicit conversion of nil into String
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws.rb:97:in `digest'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws.rb:97:in `sign'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws.rb:230:in `sign_request'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws.rb:218:in `generate_signature'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws.rb:176:in `generate'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws.rb:780:in `make_request'
/var/lib/gems/2.3.0/gems/miasma-0.3.4/lib/miasma/types/api.rb:124:in `block in request'
/var/lib/gems/2.3.0/gems/bogo-0.2.12/lib/bogo/retry.rb:65:in `run!'
/var/lib/gems/2.3.0/gems/miasma-0.3.4/lib/miasma/types/api.rb:148:in `retryable_request'
/var/lib/gems/2.3.0/gems/miasma-0.3.4/lib/miasma/types/api.rb:123:in `request'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws/orchestration.rb:80:in `block in load_stack_data'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws.rb:32:in `all_result_pages'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws/orchestration.rb:77:in `load_stack_data'
/var/lib/gems/2.3.0/gems/miasma-aws-0.3.14/lib/miasma/contrib/aws/orchestration.rb:539:in `stack_all'
/var/lib/gems/2.3.0/gems/miasma-0.3.4/lib/miasma/models/orchestration/stacks.rb:28:in `perform_population'
/var/lib/gems/2.3.0/gems/miasma-0.3.4/lib/miasma/types/collection.rb:21:in `block in all'
/var/lib/gems/2.3.0/gems/bogo-0.2.12/lib/bogo/memoization.rb:64:in `memoize'
/var/lib/gems/2.3.0/gems/miasma-0.3.4/lib/miasma/types/collection.rb:20:in `all'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/provider.rb:178:in `block in fetch_stacks'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/cache.rb:263:in `block in locked_action'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/cache.rb:319:in `lock'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/cache.rb:262:in `locked_action'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/provider.rb:171:in `fetch_stacks'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/provider.rb:101:in `cached_stacks'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/provider.rb:91:in `stacks'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/command/list.rb:36:in `get_stacks'
/var/lib/gems/2.3.0/gems/bogo-ui-0.1.28/lib/bogo-ui/table.rb:35:in `method_missing'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/command/list.rb:13:in `block (3 levels) in execute!'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/command_module/callbacks.rb:20:in `api_action!'
/var/lib/gems/2.3.0/gems/bogo-ui-0.1.28/lib/bogo-ui/table.rb:35:in `method_missing'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/command/list.rb:13:in `block (2 levels) in execute!'
/var/lib/gems/2.3.0/gems/bogo-ui-0.1.28/lib/bogo-ui/table.rb:56:in `table'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/command/list.rb:12:in `block in execute!'
/var/lib/gems/2.3.0/gems/bogo-ui-0.1.28/lib/bogo-ui/table.rb:78:in `instance_exec'
/var/lib/gems/2.3.0/gems/bogo-ui-0.1.28/lib/bogo-ui/table.rb:78:in `display'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/lib/sfn/command/list.rb:29:in `execute!'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/bin/sfn:52:in `block (4 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/bogo-cli-0.2.14/lib/bogo-cli/setup.rb:26:in `block in bogo_cli_run'
/var/lib/gems/2.3.0/gems/slop-3.6.0/lib/slop.rb:260:in `parse!'
/var/lib/gems/2.3.0/gems/slop-3.6.0/lib/slop.rb:235:in `parse!'
/var/lib/gems/2.3.0/gems/slop-3.6.0/lib/slop.rb:65:in `parse!'
/var/lib/gems/2.3.0/gems/slop-3.6.0/lib/slop.rb:54:in `parse'
/var/lib/gems/2.3.0/gems/bogo-cli-0.2.14/lib/bogo-cli/setup.rb:48:in `define'
/var/lib/gems/2.3.0/gems/sfn-3.0.30/bin/sfn:14:in `<top (required)>'
/usr/local/bin/sfn:22:in `load'
/usr/local/bin/sfn:22:in `<main>'
chrisroberts commented 6 years ago

Hi there. I believe I know where the issue is located. Pinning the miasma-aws dependency at version 0.3.12 will get things working for right now. I should be able to get a fix applied and released this evening.

chrisroberts commented 6 years ago

Hi. I have release 0.3.16 that includes the fix for this issue. Thanks for the report!