[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 :-)

View original on GitHub ↗

22 Comments

malginin · 1 year ago
joennlae · 1 year ago
Escape the slash in ARN like so #297 (comment)

Thank you for the tip. I already tried that. No change on my side.

sdcampbell · 1 year ago

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 %2F and that didn't work.

I've tested this on MacOS and Debian Linux (ARM64) and both have the same issue.

sdcampbell · 1 year ago

I also tried using the following command to set the environment for Claude Code and still got the error:

claude config set --global env '{"CLAUDE_CODE_USE_BEDROCK": "true", "ANTHROPIC_MODEL": "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-7-sonnet-20250219-v1:0"}'
sdcampbell · 1 year ago

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" />

malginin · 1 year ago

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.

sdcampbell · 1 year ago
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

sdcampbell · 1 year ago

This command works:

ANTHROPIC_MODEL=us.anthropic.claude-3-7-sonnet-20250219-v1:0 CLAUDE_CODE_USE_BEDROCK=1 claude

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.

acholonu · 1 year ago
This command works: `` ANTHROPIC_MODEL=us.anthropic.claude-3-7-sonnet-20250219-v1:0 CLAUDE_CODE_USE_BEDROCK=1 claude `` 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.

q2mark · 1 year ago

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.

mark@WSL-PC:~/test-dir$ claude --debug
╭────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│                                            │
│   /help for help                           │
│                                            │
│   cwd: /home/mark/test-dir                 │
│                                            │
│   ──────────────────────────────────────── │
│                                            │
│   Overrides (via env):                     │
│                                            │
│   • Model: bedrock/us.anthropic.claude-3-7 │
│   -sonnet-20250219-v1:0                    │
╰────────────────────────────────────────────╯

 Tips for getting started:

 1. Ask Claude to create a new app or clone a repository
 2. Use Claude to help with file analysis, editing, bash commands and git
 3. Be as specific as you would with another engineer for the best results

 ※ Tip: Use git worktrees to run multiple Claude sessions in parallel. Learn more (​https://docs.anthropic.com/s/claude-code-worktrees​)

> hello
  ⎿  Interrupted by user
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                                                                                       │
│╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
││ >                                                                                                                                                                   ││
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
│  ? for shortcuts                                                                                0 tokens (100% cached) globalVersion: 0.2.86 · latestVersion: 0.2.86  │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Clabes · 1 year ago

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:0
doesn'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"}'

Clabes · 1 year ago

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"}'

q2mark · 1 year ago
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!

FredericOdermatt · 1 year ago

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-1 and could not get past the Interrupted By User issue (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 in eu-central-1 Sonnet has an inference profile, and Haiku doesn't. I'm not sure whether this could be why some US users flakingly get it working.

Clabes · 1 year ago

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 the aws configure account by simply pressing enter as the configuration will be drawing for your profile).

FredericOdermatt · 1 year ago

Thanks, unlocking for all regions where the inference profile goes has been a great pointer!

Check regions using

aws bedrock list-inference-profiles --region eu-central-1 | grep -B 3 "claude-3-7"

✅ US inference profile

ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0' \
ANTHROPIC_SMALL_FAST_MODEL='us.anthropic.claude-3-5-haiku-20241022-v1:0' \
CLAUDE_CODE_USE_BEDROCK=1 \
DISABLE_PROMPT_CACHING=1 DEBUG=1 \
claude --verbose --debug
> hi there

● Hello! How can I help you today?

❌ Seems like ARN's don't work, as expected:

ANTHROPIC_MODEL='arn:aws:bedrock:us-east-1:XXXXXXXXXX:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0' \
ANTHROPIC_SMALL_FAST_MODEL='arn:aws:bedrock:us-east-1:XXXXXXXXXX:inference-profile/us.anthropic.claude-3-5-haiku-20241022-v1:0' \
CLAUDE_CODE_USE_BEDROCK=1 \
DISABLE_PROMPT_CACHING=1 DEBUG=1 \
claude --verbose --debug
> hi there
  ⎿  API Error: Failed to get response from API (com.amazon.coral.service#UnknownOperationException)

❌ EU inference profile sonnet 3.7

ANTHROPIC_MODEL='eu.anthropic.claude-3-7-sonnet-20250219-v1:0' \
ANTHROPIC_SMALL_FAST_MODEL='eu.anthropic.claude-3-haiku-20240307-v1:0' \
CLAUDE_CODE_USE_BEDROCK=1 \
DISABLE_PROMPT_CACHING=1 DEBUG=1 \
claude --verbose --debug
> hi there
  ⎿  API Error (eu.anthropic.claude-3-7-sonnet-20250219-v1:0): 400 The provided model identifier is invalid.

❌ EU inference profile sonnet 3.5

ANTHROPIC_MODEL='eu.anthropic.claude-3-5-sonnet-20240620-v1:0' \
ANTHROPIC_SMALL_FAST_MODEL='eu.anthropic.claude-3-haiku-20240307-v1:0' \
CLAUDE_CODE_USE_BEDROCK=1 \
DISABLE_PROMPT_CACHING=1 DEBUG=1 \
claude --verbose --debug
> hi there
  ⎿  API Error (eu.anthropic.claude-3-5-sonnet-20240620-v1:0): 400 The provided model identifier is invalid.

Note that EU doesn't have haiku 3.5

For now I'll just eat the 200ms delay and work with US inference profiles.

Clabes · 1 year ago
Thanks, unlocking for all regions where the inference profile goes has been a great pointer!
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.

ant-kurt collaborator · 1 year ago

@FredericOdermatt prior to v0.2.125, ARNs required escaping the slash (%2F); without this, you would get com.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.

ant-kurt collaborator · 1 year ago

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.

q2mark · 1 year ago
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.

FredericOdermatt · 1 year ago

Another test with claude 1.0.30 and specifying AWS_REGION='...' is working for eu and us now

ANTHROPIC_MODEL='arn:aws:bedrock:us-west-2:xxxxxxxxxx:foundation-model%2Fanthropic.claude-3-7-sonnet-20250219-v1:0' \
ANTHROPIC_SMALL_FAST_MODEL='arn:aws:bedrock:us-west-2:xxxxxxxxxx:foundation-model%2Fanthropic.claude-instant-v1:2:100k' \
CLAUDE_CODE_USE_BEDROCK=1 \
DISABLE_PROMPT_CACHING=1 DEBUG=1 \
AWS_REGION='us-west-2' \
claude
ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0' \
ANTHROPIC_SMALL_FAST_MODEL='us.anthropic.claude-3-5-haiku-20241022-v1:0' \
CLAUDE_CODE_USE_BEDROCK=1 \
DISABLE_PROMPT_CACHING=1 DEBUG=1 \
AWS_REGION='us-west-2' \
claude
github-actions[bot] · 11 months ago

This 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.