Bedrock Authentication. AWS profile with name default not found in ~/.aws/credentials, using default profile
Before submitting your bug report
- [X] I believe this is a bug. I'll try to join the Continue Discord for questions
- [X] I'm not able to find an open issue that reports the same bug
- [X] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: MacOS 14.3 (23D56)
- Continue:
Published
2023-05-27, 15:17:59
Last released
2024-09-25, 02:42:21
- IDE: VS Code
- Model: anthropic.claude-3-5-sonnet-20240620-v1:0
- config.json:
{
"models": [
{
"title": "Claude 3.5 Sonnet",
"provider": "bedrock",
"model": "anthropic.claude-3-5-sonnet-20240620-v1:0",
"region": "us-east-1",
"profile": "default"
}
]
}
Description
I am attempting to configure cursor to use claude 3.5 sonnet via AWS Bedrock. Currently my aws configuration and credentials are as follows
Context
cat ~/.aws/config | pbcopy:
[default]
region = us-east-1
output = json
cat ~/.aws/credentials | pbcopy: (with values omitted)
[default]
aws_access_key_id = <key_id>
aws_secret_access_key = <key>
aws_session_token = <token>
I am confident that these credentials+config are fine because I am able to invoke the model directly via the AWS CLI
aws bedrock-runtime converse \
--model-id anthropic.claude-3-5-sonnet-20240620-v1:0 \
--messages '[{"role": "user", "content": [{"text": "Describe the purpose of a \"hello world\" program in one line."}]}]' \
--inference-config '{"maxTokens": 512, "temperature": 0.5, "topP": 0.9}' | pbcopy
{
"output": {
"message": {
"role": "assistant",
"content": [
{
"text": "A \"hello world\" program demonstrates the basic syntax of a programming language by displaying a simple greeting message."
}
]
}
},
"stopReason": "end_turn",
"usage": {
"inputTokens": 22,
"outputTokens": 24,
"totalTokens": 46
},
"metrics": {
"latencyMs": 960
}
}
Problem
I have attempted to configure continue to use the same model and the same profile + credentials
cat ~/.continue/config.json | pbcopy
{
"models": [
{
"title": "Claude 3.5 Sonnet",
"provider": "bedrock",
"model": "anthropic.claude-3-5-sonnet-20240620-v1:0",
"region": "us-east-1",
"profile": "default"
}
]
}
However when I attempt to use the chat interface, I get the following error message
Could not resolve credentials using profile: [default] in configuration/credentials file(s).
The logs contain a suspicious warning
AWS profile with name default not found in ~/.aws/credentials, using default profile
At first I thought I made some dumb whitespace or spelling mistake but I do not believe I did. With the exception of omitting my aws keys, the files I have provided are unmodified, piped directly from cat into pbcopy
To reproduce
- open chat interface with
cmd+L - type a test prompt such as 'hello'
- press the enter button
- observe error
Log output
console.ts:137 [Extension Host] AWS profile with name default not found in ~/.aws/credentials, using default profile
console.ts:137 [Extension Host] CredentialsProviderError: Could not resolve credentials using profile: [default] in configuration/credentials file(s).
at resolveProfileData (/Users/cam.white/.vscode/extensions/continue.continue-0.8.52-darwin-arm64/out/extension.js:477034:13)
at /Users/cam.white/.vscode/extensions/continue.continue-0.8.52-darwin-arm64/out/extension.js:477043:14
at async Bedrock._getCredentials (/Users/cam.white/.vscode/extensions/continue.continue-0.8.52-darwin-arm64/out/extension.js:483872:18)
at async Bedrock._streamChat (/Users/cam.white/.vscode/extensions/continue.continue-0.8.52-darwin-arm64/out/extension.js:483785:29)
at async Bedrock.streamChat (/Users/cam.white/.vscode/extensions/continue.continue-0.8.52-darwin-arm64/out/extension.js:104627:30)
at async llmStreamChat (/Users/cam.white/.vscode/extensions/continue.continue-0.8.52-darwin-arm64/out/extension.js:516613:23)
at async i.value (/Users/cam.white/.vscode/extensions/continue.continue-0.8.52-darwin-arm64/out/extension.js:523115:29)
log.ts:439 ERR [Extension Host] Error handling webview message: {
"msg": {
"messageId": "b16c15e4-40c0-464b-b905-7c2149a86e7e",
"messageType": "llm/streamChat",
"data": {
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "hello"
}
]
}
],
"title": "Claude 3.5 Sonnet",
"completionOptions": {}
}
}
}
CredentialsProviderError: Could not resolve credentials using profile: [default] in configuration/credentials file(s).
console.ts:137 [Extension Host] Error handling webview message: {
"msg": {
"messageId": "b16c15e4-40c0-464b-b905-7c2149a86e7e",
"messageType": "llm/streamChat",
"data": {
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "hello"
}
]
}
],
"title": "Claude 3.5 Sonnet",
"completionOptions": {}
}
}
}
CredentialsProviderError: Could not resolve credentials using profile: [default] in configuration/credentials file(s).
notificationsAlerts.ts:42 Could not resolve credentials using profile: [default] in configuration/credentials file(s).
Hi @cam-white-aeroflow , thanks for the great writeup here! The Bedrock provider was contributed by a community member so unfortunately I'm not the most familiar with it.
This appears to be the lines you're hitting: https://github.com/continuedev/continue/blob/main/core/llm/llms/Bedrock.ts#L152-L164
My only thought is to perhaps try removing the profile from your config.json, e.g.
{
"models": [
{
"title": "Claude 3.5 Sonnet",
"provider": "bedrock",
"model": "anthropic.claude-3-5-sonnet-20240620-v1:0",
"region": "us-east-1",
}
]
}
This should then set your profile to "bedrock", which should fail, and then fallback to the default profile here: https://github.com/continuedev/continue/blob/main/core/llm/llms/Bedrock.ts#L161
Other than that my best guess is that there is some unexpected behavior going on with the fromIni method we're importing: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-credential-providers/Variable/fromIni/
Apologies for the inconclusive troubleshooting though.
cc @KoStard - wondering if you have any insights here.
@cam-white-aeroflow running into this issue as well, any luck on solving this?
Any update ?
Hi folks, no updates here on our end yet but the issue is on our radar. If any folks are familiar with the @aws-sdk/credential-providers which seems to be the root of the issue , contributions would be greatly appreciated!
This whole implementation is garbage. It requires aws (secret) access keys to be in the config (or to have a config at all). There are many different auth options than this. I'm working on an EC2 instance and just wanted to use the IAM sts:assumeRole policies. Just using const client = new BedrockRuntimeClient({ }); would have been worked better than this. See examples: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/javascript_bedrock-runtime_code_examples.html
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!