Aws-sdk-ruby: undefined method `match' for nil:NilClass (NoMethodError) when opening encryptionClient

Created on 11 Jul 2016  路  3Comments  路  Source: aws/aws-sdk-ruby

  1. Install

gem install aws-sdk
Successfully installed aws-sdk-2.3.21
Parsing documentation for aws-sdk-2.3.21
Done installing documentation for aws-sdk after 0 seconds
1 gem installed

  1. code
    more DS3.rb
    require 'aws-sdk'
    require 'openssl'

key = OpenSSL::PKey::RSA.new(1024)
s3 = Aws::S3::Encryption::Client.new(encryption_key: key)

  1. execute
    ruby DS3.rb
    /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/endpoint_provider.rb:67:in block in partition_matching_region': undefined methodmatch' for nil:NilClass (NoMethodError)
    Did you mean? catch
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/endpoint_provider.rb:66:in each' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/endpoint_provider.rb:66:infind'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/endpoint_provider.rb:66:in partition_matching_region' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/endpoint_provider.rb:55:inget_partition'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/endpoint_provider.rb:26:in endpoint_for' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/endpoint_provider.rb:10:inresolve'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/endpoint_provider.rb:80:in resolve' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/aws-sdk-core/plugins/regional_endpoint.rb:24:inblock in class:RegionalEndpoint'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:70:in call' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:205:inblock in resolve_defaults'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:57:in each' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:57:ineach'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:204:in resolve_defaults' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:200:invalue_at'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:189:in block in resolve' from /usr/local/Cellar/ruby/2.3.0/lib/ruby/2.3.0/set.rb:306:ineach_key'
    from /usr/local/Cellar/ruby/2.3.0/lib/ruby/2.3.0/set.rb:306:in each' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:189:inresolve'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:177:in apply_defaults' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/configuration.rb:150:inbuild!'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/base.rb:68:in build_config' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/base.rb:19:ininitialize'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-core-2.3.21/lib/seahorse/client/base.rb:105:in new' from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-resources-2.3.21/lib/aws-sdk-resources/services/s3/encryption/client.rb:298:inextract_client'
    from /usr/local/lib/ruby/gems/2.3.0/gems/aws-sdk-resources-2.3.21/lib/aws-sdk-resources/services/s3/encryption/client.rb:221:in initialize' from DS3.rb:5:innew'
    from DS3.rb:5:in `
    '

Most helpful comment

Related to #1237

This means you haven't configured a region. To configure a region, set the AWS_REGION environment variable, or pass it in as a parameter. For example:

key = OpenSSL::PKey::RSA.new(1024)
s3 = Aws::S3::Encryption::Client.new(encryption_key: key, region: "us-east-1") # or the region you are using

All 3 comments

Related to #1237

This means you haven't configured a region. To configure a region, set the AWS_REGION environment variable, or pass it in as a parameter. For example:

key = OpenSSL::PKey::RSA.new(1024)
s3 = Aws::S3::Encryption::Client.new(encryption_key: key, region: "us-east-1") # or the region you are using

From: Alex Wood <[email protected]notifications@github.com>
Reply-To: aws/aws-sdk-ruby <[email protected]reply@reply.github.com>
Date: Monday, July 11, 2016 at 4:10 PM
To: aws/aws-sdk-ruby <[email protected]aws-sdk-ruby@noreply.github.com>
Cc: Dan Blondowski [email protected]dan.blondowski@dhigroupinc.com>, Author <[email protected]author@noreply.github.com>
Subject: Re: [aws/aws-sdk-ruby] undefined method `match' for nil:NilClass (NoMethodError) when opening encryptionClient (#1240)

Related to #1237https://github.com/aws/aws-sdk-ruby/issues/1237

This means you haven't configured a region. To configure a region, set the AWS_REGION environment variable, or pass it in as a parameter. For example:

key = OpenSSL::PKey::RSA.new(1024)
s3 = Aws::S3::Encryption::Client.new(encryption_key: key, region: "us-east-1") # or the region you are using

You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHubhttps://github.com/aws/aws-sdk-ruby/issues/1240#issuecomment-231866239, or mute the threadhttps://github.com/notifications/unsubscribe/AGsPJTfOr2XXmtRVqfx5Iq7PYvau7tTlks5qUrFYgaJpZM4JJxUl.

This email has been scanned for email related threats and delivered safely by Mimecast.

For more information please visit http://www.mimecast.com

It's an unhelpful error that I'm aiming to fix, though it's something I can't consistently reproduce either so it's been slightly elusive. Sorry about the unhelpful error message.

Was this page helpful?
0 / 5 - 0 ratings