Skip to content

Conversation

@dobrite
Copy link
Contributor

@dobrite dobrite commented Nov 24, 2025

We're invoking the credential provider chain in our production code with no args:

Aws::CredentialProviderChain.new.resolve

This fails on 176 with a NameError when config is enabled:

NameError:
  undefined local variable or method `region' for #<Aws::CredentialProviderChain:0x00000001094dc100 @config=nil>
aws-sdk-core-3.239.1/lib/aws-sdk-core/credential_provider_chain.rb:176:in `login_credentials'
aws-sdk-core-3.239.1/lib/aws-sdk-core/credential_provider_chain.rb:13:in `block in resolve'
aws-sdk-core-3.239.1/lib/aws-sdk-core/credential_provider_chain.rb:12:in `each'
aws-sdk-core-3.239.1/lib/aws-sdk-core/credential_provider_chain.rb:12:in `resolve'

PR #33191 inadvertently caused this error by not checking if config was passed. Elsewhere in the file the code is guarding against that.

Write a failing test, then make it pass.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

  1. To make sure we include your contribution in the release notes, please make sure to add description entry for your changes in the "unreleased changes" section of the CHANGELOG.md file (at corresponding gem). For the description entry, please make sure it lives in one line and starts with Feature or Issue in the correct format.

  2. For generated code changes, please checkout below instructions first:
    https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md

Thank you for your contribution!

Footnotes

  1. https://github.com/aws/aws-sdk-ruby/pull/3319

We're invoking the credential provider chain in our production code with
no args:

```
Aws::CredentialProviderChain.new.resolve
```

This fails on 176 with a `NameError` when config is enabled:

```
NameError:
  undefined local variable or method `region' for #<Aws::CredentialProviderChain:0x00000001094dc100 @config=nil>
aws-sdk-core-3.239.1/lib/aws-sdk-core/credential_provider_chain.rb:176:in `login_credentials'
aws-sdk-core-3.239.1/lib/aws-sdk-core/credential_provider_chain.rb:13:in `block in resolve'
aws-sdk-core-3.239.1/lib/aws-sdk-core/credential_provider_chain.rb:12:in `each'
aws-sdk-core-3.239.1/lib/aws-sdk-core/credential_provider_chain.rb:12:in `resolve'
```

PR aws#3319[^1] inadvertently caused this error by not checking if config
was passed. Elsewhere in the file the code is guarding against that.

Write a failing test, then make it pass.

[^1]: aws#3319
@kwent
Copy link

kwent commented Nov 25, 2025

cc @jterapin @richardwang1124

@jterapin
Copy link
Contributor

Really sorry you're hitting this issue. We didn't expect changes to an api private class to have this kind of ripple effect, but myself and @richardwang1124 will be taking a look today. Thank you for your patience.

@richardwang1124
Copy link
Contributor

Hey all, sorry for breaking your workflow with this change. You are correct, config should be checked first before extracting the region. I've approved the PR and will merge it for today's release. Thank you for your patience!

Copy link
Contributor

@jterapin jterapin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@jterapin jterapin merged commit 74f2b0d into aws:version-3 Nov 25, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants