Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

undefined method `access_key_id' #386

Closed
jamesalbert opened this issue Nov 7, 2017 · 1 comment
Closed

undefined method `access_key_id' #386

jamesalbert opened this issue Nov 7, 2017 · 1 comment

Comments

@jamesalbert
Copy link

jamesalbert commented Nov 7, 2017

Fresh install, getting this error. Reminds me of #235 but I'm not sure which option could be missing. My credentials are in ~/.aws which I assume should be enough. Any thoughts?

specs:

  • ruby: 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
  • terraform: 0.10.8
  • os: MacOS High Sierra 10.13
jbert@ip-192-168-0-109 [~/] ⨏ terraforming s3 --profile=cloudbees-test-admin --region=us-east-1
/Library/Ruby/Gems/2.3.0/gems/aws-sigv4-1.0.2/lib/aws-sigv4/signer.rb:575:in `credentials_set?': undefined method `access_key_id' for nil:NilClass (NoMethodError)
	from /Library/Ruby/Gems/2.3.0/gems/aws-sigv4-1.0.2/lib/aws-sigv4/signer.rb:566:in `get_credentials'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sigv4-1.0.2/lib/aws-sigv4/signer.rb:204:in `sign_request'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/signature_v4.rb:110:in `apply_signature'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/s3_signer.rb:53:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/s3_host_id.rb:15:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/xml/error_handler.rb:8:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/helpful_socket_errors.rb:10:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/s3_signer.rb:87:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/redirects.rb:18:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/retry_errors.rb:92:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/dualstack.rb:34:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/md5s.rb:28:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb:13:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/expect_100_continue.rb:22:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/bucket_dns.rb:33:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/rest/handler.rb:8:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/user_agent.rb:13:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/seahorse/client/plugins/endpoint.rb:45:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/param_validator.rb:24:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/seahorse/client/plugins/raise_response_errors.rb:14:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/sse_cpk.rb:22:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/plugins/dualstack.rb:26:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/param_converter.rb:24:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/seahorse/client/plugins/response_target.rb:23:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.6.1/lib/seahorse/client/request.rb:70:in `send_request'
	from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-s3-1.5.0/lib/aws-sdk-s3/client.rb:3261:in `list_buckets'
	from /Library/Ruby/Gems/2.3.0/gems/terraforming-0.16.0/lib/terraforming/resource/s3.rb:56:in `buckets'
	from (erb):1:in `apply_template'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/erb.rb:864:in `eval'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/erb.rb:864:in `result'
	from /Library/Ruby/Gems/2.3.0/gems/terraforming-0.16.0/lib/terraforming/util.rb:4:in `apply_template'
	from /Library/Ruby/Gems/2.3.0/gems/terraforming-0.16.0/lib/terraforming/resource/s3.rb:19:in `tf'
	from /Library/Ruby/Gems/2.3.0/gems/terraforming-0.16.0/lib/terraforming/resource/s3.rb:7:in `tf'
	from /Library/Ruby/Gems/2.3.0/gems/terraforming-0.16.0/lib/terraforming/cli.rb:258:in `tf'
	from /Library/Ruby/Gems/2.3.0/gems/terraforming-0.16.0/lib/terraforming/cli.rb:245:in `execute'
	from /Library/Ruby/Gems/2.3.0/gems/terraforming-0.16.0/lib/terraforming/cli.rb:190:in `s3'
	from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
	from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
	from /Library/Ruby/Gems/2.3.0/gems/terraforming-0.16.0/bin/terraforming:5:in `<top (required)>'
	from /usr/local/bin/terraforming:22:in `load'
	from /usr/local/bin/terraforming:22:in `<main>'
@dtan4
Copy link
Owner

dtan4 commented Dec 24, 2017

Maybe you are missing the correct credential file or its body is wrong.
Please check the existence of ~/.aws/credentials and its body.

$ cat ~/.aws/credentials
[dtan4]
aws_access_key_id = AKIA***
aws_secret_access_key = ***

I tested with

  • no ~/.aws/config but specify --profile XXX
  • ~/.aws/config exists but its body has typo: aaccess_key_id = AKIA***

Both cases return the error you reported.

Thanks!

@dtan4 dtan4 closed this as completed Dec 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants