How do I troubleshoot "400 Error Code" errors that I receive when I use CloudFormation for ElastiCache?

5 minute read
0

I want to troubleshoot "400 Error Code" errors that I receive when I use AWS CloudFormation for Amazon ElastiCache.

Short description

When you start an AWS API request directly or use a CloudFormation stack, AWS performs initial syntax checks. The checks verify that the request is complete and has all the mandatory parameters. If a check fails, then you receive an error.

The following are 400 Error Code errors and the reasons that they occur when you send an API request for ElastiCache:

  • You receive a Throttling error when the request is denied because of API request throttling.
  • You receive an InsufficientCacheClusterCapacity error when AWS doesn't have enough available capacity to complete your request.
  • You receive a SubnetInUse error because the subnet that you're trying to remove has associated instances.
  • You receive an InvalidParameterValue when you use a parameter value that isn't valid, isn't supported, or you can't use in your request.
  • You receive an InvalidParameterCombination when your request has an incorrect combination of parameters or a missing parameter.

To resolve the 400 Error Code errors, identify the specific ElastiCache invoke API error that you received, and then take the appropriate actions.

Note: For a list of possible errors and their descriptions, see Common errors.

Resolution

Throttling

You receive the following error message:

"Rate exceeded (Service: AmazonElastiCache; Status Code: 400; Error Code: Throttling; Request ID: ###)"

AWS account-level API call quotas aren't service specific. You can't increase or modify quotas for a specific API call. API calls can't exceed the maximum allowed API request rate, even for calls from an application, command line interface (CLI), or the AWS Management Console.

To resolve this error, take the following actions:

  • Use exponential backoff with jitter to retry your call.
  • Distribute your API calls evenly over time, and don't make several API calls in a short time period.

InsufficientCacheClusterCapacity

You receive the following error message:

"Cache.### (VPC) is not currently supported in the availability zone ###. Retry the launch with no availability zone or target: ###. (Service: AmazonElastiCache; Status Code: 400; Error Code: InsufficientCacheClusterCapacity; Request ID: ###)"

To resolve this error, take the following actions:

  • Because capicity frequently shifts, wait a few minutes, and then resubmit your request.
  • Use another cache node type, and then resubmit your request.
  • Use another subnet and Availability Zone, and then resubmit your request.

For more information, see Error Messages: InsufficientCacheClusterCapacity.

SubnetInUse

You receive the following error message:

"The subnet ID subnet-### is in use (Service: AmazonElastiCache; Status Code: 400; Error Code: SubnetInUse; Request ID: ###)"

To resolve this error, remove all associated resources from the subnet, and then resubmit your request. For more information, see Examples.

InvalidParameterValue

Check each parameter for your request call. If the parameter value isn't valid, is unsupported, or can't be used in your request, then you receive one of the following error messages.

"Invalid AuthToken provided. (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterValue"; Request ID: ###)"

To resolve the previous error, make sure that your auth-token setting meets the constraints when you use AUTH with ElastiCache for Redis. For more information, see Authenticating with the Valkey and Redis OSS AUTH command.

"The snapshot window and maintenance window must not overlap. (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterValue; Request ID: ###)"

To resolve the previous error, separate your snapshot windows and maintenance windows into different time periods. You can't set up snapshot windows and maintenance windows at the same time.

"The number of replicas per node group must be within 0 and 5. (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterValue; Request ID: ###)"

To resolve the previous error, only add up to 5 replica nodes. ElastiCache for Redis supports one primary node and zero to five replica nodes per shard. For more information, see Understanding Valkey and Redis OSS replication.

InvalidParameterCombination

If the request call has an incorrect combination of parameters or a missing parameter, then you might receive one of the following error messages.

"Cannot find version 5.0.0 for redis (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: ###)"

This error shows that the version of Redis in your request call isn't supported. For more information, see Supported Redis OSS versions and Supported Memcached versions.

"Cannot restore redis from 6.0.5 to 5.0.6. (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: ###)"

To resolve the previous error, make sure that your Redis engine version is newer than or equal to the current engine version. ElastiCache for Redis doesn't support downgraded Redis engine versions when you use a backup to create a new Redis cluster. Also, ElastiCache for Redis doesn't downgrade the Redis engine of a running Redis cluster. For more information, see Comparing Valkey, Memcached, and Redis OSS self-designed caches.

"When using automatic failover, there must be at least 2 cache clusters in the replication group. (Service: AmazonElastiCache; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: ###)"

To resolve the previous error, turn on the automatic failover option in a Redis cluster that has at least one available read replica on it. Verify that your Redis replication group has more than one replica node, and then resubmit your request. For more information, see Minimizing downtime in ElastiCache by using Multi-AZ with Valkey and Redis OSS.

Related information

Quotas for ElastiCache

Persistent connection issues

Installing or updating to the latest version of the AWS CLI