Troubleshooting Amazon Bedrock API Error Codes (original) (raw)

This section provides detailed information about the common errors you might encounter when using Amazon Bedrock APIs, the cause of the error, and the solution for resolving the error.

AccessDeniedException

HTTP Status Code: 403

Cause: You do not have sufficient permissions to perform the requested action.

Solution:

FTUFormNotFilled

HTTP Status Code: 404

Cause: Model use case details have not been submitted for this account

Solution:

IncompleteSignature

HTTP Status Code: 400

Cause: The request signature does not conform to AWS standards.

Solution:

InternalFailure

HTTP Status Code: 500

Cause: The request processing has failed due to a server error

Solution:

InvalidAction

HTTP Status Code: 400

Cause: The action or operation requested is invalid

Solution:

InvalidClientTokenId

HTTP Status Code: 403

Cause: The X.509 certificate or AWS access key ID provided does not exist in our records.

Solution:

AWS Marketplace Agreement Failed within 15 minutes

HTTP Status Code: 403

Cause: The AWS Marketplace Agreement failed due to an underlying issue.

Solution:

AWS Marketplace Agreement Pending after 15 minutes

HTTP Status Code: 403

Cause: The AWS Marketplace Agreement has not succeeded and it has been 15 minutes since the request was made.

Solution:

MPAgreementBeingCreated

HTTP Status Code: 403

Cause: Your account is not authorized to access this model. Your AWS Marketplace subscription for this model is still being processed

Solution:

HTTP Status Code: 400

Cause: You do not have permission to perform this action.

Solution:

RequestExpired

HTTP Status Code: 400

Cause: The request is no longer valid due to expired timestamps.

Solution:

ServiceUnavailable

HTTP Status Code: 503

Cause: The service is temporarily unable to handle the request. 503 errors indicate that the service is experiencing high demand or temporary capacity constraints. This is not related to your account-level quotas or rate limits (which return 429 ThrottlingException).

Solution:

Best practices

If you experience frequent 503 errors or if they significantly impact your operations, please contact AWS Supportfor further assistance and guidance tailored to your specific use case.

ThrottlingException

HTTP Status Code: 429

Cause: The request was denied due to exceeding the account quotas for Amazon Bedrock.

Solution:

ValidationError

HTTP Status Code: 400

Cause: The input fails to satisfy the constraints specified by Amazon Bedrock.

Solution:

ResourceNotFound

HTTP Status Code: 404

Cause: The requested resource could not be found.

Solution:

Best practices

If you continue to experience issues after trying these solutions, contact AWS Supportfor further assistance and guidance tailored to your specific use case.

Connection timeout or reset on long-running or idle connections

Symptom: API calls fail with connection resets or timeouts, especially for long-running requests such as streaming, extended thinking, or large inference responses, when traffic goes through NAT Gateways, interface VPC endpoints, or Network Load Balancers. Symptoms can also appear as long cold-start latency (for example, the first call after an idle period takes 70+ seconds instead of the usual few) when an idle pooled connection is reused after the network has silently dropped it.

Cause: NAT Gateways, interface VPC endpoints, and Network Load Balancers have a fixed idle connection timeout of 350 seconds. If a TCP connection remains idle longer than this period, the connection is dropped without notifying the client. The client may not detect the dropped connection until the next request, at which point it must wait for the OS-level TCP retry or timeout before reestablishing the connection.

When this applies:

Solution:

Enabling TCP keep-alive on the Amazon Bedrock client requires two settings working together. Setting only one is not enough.

  1. Enable TCP keep-alive in your AWS SDK client. The boto3 Config object accepts a tcp_keepalive parameter, which defaults to False. Set it to True when constructing the Amazon Bedrock client:
import boto3  
from botocore.config import Config  
config = Config(tcp_keepalive=True)  
client = boto3.client("bedrock-runtime", config=config)  

For other AWS SDKs, see the corresponding HTTP client configuration documentation. 2. Configure the OS-level keep-alive interval to fire before the 350-second idle timeout. Linux defaults to net.ipv4.tcp_keepalive_time = 7200 (2 hours), which is much longer than the NAT or VPC endpoint idle timeout, so SDK-level keep-alive alone has no effect. Lower the kernel setting to a value safely below 350 seconds (for example, 45 seconds):

sysctl -w net.ipv4.tcp_keepalive_time=45  

On Amazon EKS and Amazon ECS, apply the sysctl in the pod or task securityContext, in an init container, or in a custom node AMI. On Amazon EC2, set it in /etc/sysctl.d/ so the value persists across reboots.

For a deeper discussion of long-running TCP connections in VPC networking, see Implementing long-running TCP Connections within VPC networking on the AWS Networking & Content Delivery Blog.

If you continue to experience connection issues after applying both settings, contact AWS Support for further assistance.