Skip to content

Failed to Load AWS Credentials for Authentication in Virtual Environment #586

@harshakoneru7

Description

@harshakoneru7

When upgrading to langchain-aws==0.2.31, an error occurs during AWS client authentication. The issue is specific to virtual environments and does not appear when using version 0.2.30. The error message indicates that credentials could not be loaded to authenticate with the AWS client, and a region must be specified.

Error details

1 validation error for ChatBedrock Value error, Could not load credentials to authenticate with AWS client. 
Please check that the specified profile name and/or its credentials are valid. 
Service error: You must specify a region. [type=value_error, input_value={'client': <botocore.clie...se_converse_api': False}, input_type=dict]
For further information visit [https://errors.pydantic.dev/2.11/v/value_error]

Workaround

Downgrading to langchain-aws==0.2.30 resolves the issue, as the error does not occur in this version. Alternatively, explicitly specifying the region in the ChatBedrock configuration resolves the problem, as the component fails to retrieve the region from the ~/.aws/config file in version 0.2.31.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions