[BUG] AWS Bedrock "Interruped by user"
Resolved 💬 22 comments Opened Apr 5, 2025 by joennlae Closed May 22, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [x] AWS Bedrock
- Claude CLI version: 0.2.64
- Operating System: Ubuntu 24.04
- Terminal: Vscode Terminal
Bug Description
I did aws configure and tested if I can call the aws bedrock endpoints via this script.
import boto3
# aws bedrock list-foundation-models --region eu-central-1 --query "modelSummaries[*].modelId"
def test_bedrock_converse():
try:
# Initialize the Bedrock runtime client
client = boto3.client('bedrock-runtime', region_name='eu-central-1') # Replace with your region
# Define the conversation messages
user_message = [{"text": "Write a short poem about nature."}]
# Prepare the messages list
messages = [
# {"role": "system", "content": system_prompt},
{"role": "user", "content": user_message}
]
# Invoke the Converse API
# large model: arn:aws:bedrock:eu-central-1:XXXXXXXXXX:inference-profile/eu.anthropic.claude-3-7-sonnet-20250219-v1:0
response = client.converse(
modelId='arn:aws:bedrock:eu-central-1:XXXXXXXXX:inference-profile/eu.anthropic.claude-3-5-sonnet-20240620-v1:0', # Replace with your model ID
messages=messages
)
print("Response:", response)
response = response["output"]
# Extract and print the model's response
assistant_message = response['message'] # Get the last message (from assistant)
print("Assistant Response:")
print(assistant_message['content'])
except Exception as e:
print(f"An error occurred: {e}")
# Run the test function
test_bedrock_converse()
This work for both models.
Now I start claude code like this:
ANTHROPIC_MODEL='arn:aws:bedrock:eu-central-1:XXXXXXXXXX:inference-profile/eu.anthropic.claude-3-7-sonnet-20250219-v1:0' \
ANTHROPIC_SMALL_FAST_MODEL='arn:aws:bedrock:eu-central-1:XXXXXXXXXX:inference-profile/eu.anthropic.claude-3-5-sonnet-20240620-v1:0' \
CLAUDE_CODE_USE_BEDROCK=1 \
DISABLE_PROMPT_CACHING=1 DEBUG=1 \
claude --verbose --debug
I always get an Interrupted by user for any command.
> why
⎿ Interrupted by user
I also tried to set then env variable via claude config set --global env and removed them again.
Configs
Local config:
claude config list
{
"allowedTools": [],
"dontCrawlDirectory": false,
"hasTrustDialogAccepted": true,
"hasCompletedProjectOnboarding": true,
"ignorePatterns": []
}
Global config:
claude config list --global
{
"autoUpdaterStatus": "enabled",
"theme": "dark",
"verbose": false,
"preferredNotifChannel": "auto",
"shiftEnterKeyBindingInstalled": true,
"editorMode": "normal",
"autoCompactEnabled": true,
"diffTool": "terminal",
"env": {}
}
So nothing should overwrite it.
Any help would be appreciated :-)
22 Comments
Escape the slash in ARN like so https://github.com/anthropics/claude-code/issues/297#issuecomment-2715511132
Thank you for the tip. I already tried that. No change on my side.
I'm now having the same problem. I don't understand why considering the same command was working for me before. I also tried replacing the
/with%2Fand that didn't work.I've tested this on MacOS and Debian Linux (ARM64) and both have the same issue.
I also tried using the following command to set the environment for Claude Code and still got the error:
This problem is all over the place, as in has inconsistencies. During troubleshooting I found that if I created a new directory where I'd never before executed Claude then I didn't get an error. I then cloned a repository to a new directory and tried again and now get this error:
<img width="963" alt="Image" src="https://github.com/user-attachments/assets/397aa404-11f4-4dbe-8326-0af54c50698e" />
I had a few unrelated errors trying to use Claude's foundation-model ARNs. I'm not even sure they can be used directly at all. Unless your goal is to make it run wholly within your chosen region, arn:aws:bedrock:us-east-1:XXXXXXXXX:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0 should be used.
I tried that and still have the same issue. Thanks
This command works:
This is likely (suspected but not proven) because the Claude CLI is already constructing the full ARN internally when you provide it with the inference profile ID, so passing the complete ARN was causing the "Interrupted by user" error.
This worked for me too.
The above solutions didn't work for me. AWS Bedrock generally works fine via aws command line, litellm, etc. I submit a query and claude code says "percolating" and possibly one other action word, and then goes straight to "Interrupted by user"
I'm not able to submit a bug with /bug, it goes straight to "Interrupted by user"
If there's any way to print anything verbose at all here, let me know how.
I'm having the same issue. I tried pretty much every variation of using the model ARN and the cross-region reference ID that AWS gives to access the model. For info, I'm using temp AWS_ACCESS_KEY. Also, setting
ANTHROPIC_MODEL=us.anthropic.claude-3-7-sonnet-20250219-v1:0doesn't reset that variable if it was previously defined using
claude config set --global env '{"CLAUDE_CODE_USE_BEDROCK": "true", "ANTHROPIC_MODEL": "us.anthropic.claude-3-7-sonnet-20250219-v1:0"}'I just tested the command with Haiku Claude 3.0 with the prompt below and I get functionality, but with Claude 3.7 does not:
claude config set --global env '{"CLAUDE_CODE_USE_BEDROCK": "true", "ANTHROPIC_MODEL": "us.anthropic.claude-3-haiku-20240307-v1:0", "DISABLE_PROMPT_CACHING": "true"}'I tried this config, and also got claude to work, and then switched back to defaults with
claude config set --global env '{"CLAUDE_CODE_USE_BEDROCK": "true"}'and it worked!I'm facing the same issue and can't get claude code with amazon bedrock to work. I've made sure both sonnet and haiku are unlocked in aws as described here and tried with both inference profiles and foundation models in
eu-central-1and could not get past theInterrupted By Userissue (I've tried pretty much everything in this thread)Since claude code uses both Haiku and Sonnet, I've seen that for aws
us-east-1, both haiku and sonnet have inference profiles, whereas ineu-central-1Sonnet has an inference profile, and Haiku doesn't. I'm not sure whether this could be why some US users flakingly get it working.Okay, I got mine to work last week and forgot to post an update. (I'd be curious, @FredericOdermatt if this works for you.)
Simply put, I had to enable model access for every region listed in the Cross-region Inference profile which is at the bottom left of the AWS console > Bedrock. For example, for 3.7 Sonnet it lists us-east-1, us-east-2, and us-west-2. So I went to each of those regions and requested model access.
Probably that's all I needed to do, and this explains why Haiku was working for me and not 3.7 Sonnet: I had Haiku model access in all the regions while for 3.7 Sonnet I did not. For the sake of best practice I did one more thing to make sure authentication was working in my terminal, I created a new IAM admin user I was careful to configure access prior to using claude. (After setting the profile and obtaining the permission keys, save the profile name, access key ID and aws secret access key to ~/.aws/credentials and maybe add the stuff to /.aws/config?, set
export AWS_PROFILE=<profile-name>and activate it using theaws configure accountby simply pressing enter as the configuration will be drawing for your profile).Thanks, unlocking for all regions where the inference profile goes has been a great pointer!
Check regions using
✅ US inference profile
❌ Seems like
ARN's don't work, as expected:❌ EU inference profile sonnet 3.7
❌ EU inference profile sonnet 3.5
Note that EU doesn't have haiku 3.5
For now I'll just eat the 200ms delay and work with US inference profiles.
Well, glad it at least works in some location for you! Hopefully AWS can get the EU region up soon.
@FredericOdermatt prior to v0.2.125, ARNs required escaping the slash (
%2F); without this, you would getcom.amazon.coral.service#UnknownOperationException. v0.2.125 and above now expect non-escaped ARNs.When specifying inference profiles, you may need to pass
AWS_REGION.We also added some additional logging, so you may see better error messages for any lingering "Interrupted by user" or "API error" logs.
Closing this issue since it sounds like the combination of ARN handling + enabling cross-region addressed the issues. Feel free to comment or open a new issue if any problems persist.
@ant-kurt that's fine but the error message "interrupted by user" is incorrect and doesn't say what the problem is. The /bug command is also gone so it's hard to help you troubleshoot these sorts of issues.
Another test with claude
1.0.30and specifyingAWS_REGION='...'is working for eu and us nowThis issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.