Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Status code 460 on an AWS Application Load Balancer

ErrorHTTP 460

Short answer

A 460 is generated by the load balancer, not by your app. It means the client closed its connection before the idle timeout ran out, usually because your backend answered too slowly for that client. Make the target respond sooner, or make the client wait at least as long as the ALB idle timeout.

  • Applies to AWS Application Load Balancer, AWS CLI v2
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Read the current idle timeout of the load balancer, then compare it with the timeout configured in the client that gives up.

    aws elbv2 describe-load-balancer-attributes \
      --load-balancer-arn <load-balancer-arn> \
      --query "Attributes[?Key=='idle_timeout.timeout_seconds']"
  2. 2Match what you see, then jump to its fix

    1. 1Requests fail at a steady interval such as 30 seconds, below the ALB idle timeoutThe client timeout is shorter than the idle timeoutFix
    2. 2High target_processing_time in the access logs on requests that end in 460The target takes too long to answerFix
    3. 3Slow uploads or reports fail; the idle timeout is still the 60 second defaultThe idle timeout is too low for long requestsFix

What does the error look like?

  • HTTP 460
  • elb_status_code 460 in ALB access logs

Cause 1 of 3

The client timeout is shorter than the idle timeout

1Check

AWS describes 460 as the client closing the connection before the idle timeout elapsed. Look at the timeout in the calling client: HTTP library, mobile app, upstream proxy or another load balancer.

grep -rn "timeout" src/ config/

2Fix

If the client lets you, raise its timeout to match the load balancer's idle timeout.

# set the client's request timeout to at least the ALB idle timeout (60 s by default)
# the setting name depends on the client library

3Verify

The same slow request now completes and the 460 count in the access logs drops.

curl -m 70 -s -o /dev/null -w "%{http_code} %{time_total}\n" https://example.com/slow

Confirmed by docs.aws.amazon.com

Did this fix it?

Cause 2 of 3

The target takes too long to answer

1Check

The troubleshooting guide says to make sure the target responds before the client's timeout elapses.

aws elbv2 describe-target-health --target-group-arn <target-group-arn>

2Fix

Speed up the slow route, or move the long job to a background task and return at once. For a lengthy operation that must stay open, send data before each idle timeout period elapses.

# respond 202 Accepted immediately and report progress through a status endpoint

3Verify

Response times for that route fall below the client timeout.

curl -s -o /dev/null -w "%{time_total}\n" https://example.com/slow

Confirmed by docs.aws.amazon.com

Did this fix it?

Cause 3 of 3

The idle timeout is too low for long requests

1Check

The default idle timeout is 60 seconds and the valid range is 1 to 4000 seconds.

aws elbv2 describe-load-balancer-attributes --load-balancer-arn <load-balancer-arn>

2Fix

Raise the idle timeout, and keep the application's own idle timeout above it.

aws elbv2 modify-load-balancer-attributes \
  --load-balancer-arn <load-balancer-arn> \
  --attributes "Key=idle_timeout.timeout_seconds,Value=120"

3Verify

Read the attribute back and re-run the long request.

aws elbv2 describe-load-balancer-attributes --load-balancer-arn <load-balancer-arn> \
  --query "Attributes[?Key=='idle_timeout.timeout_seconds']"

Confirmed by docs.aws.amazon.com

Did this fix it?

How do I stop it coming back?

  • Keep timeouts in order: client, then ALB idle timeout, then application keep-alive.
  • Alert on the HTTPCode_ELB_4XX_Count metric so a rise in 460 is seen early.
  • Move jobs over a few seconds to a queue instead of holding a request open.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Servers

Apache has a certificate, but https:// does not open

No line with :443 in the output of ss -ltnp

HTTPS needs four things at once: mod_ssl loaded, Apache listening on 443, a virtual host on 443 with SSLEngine on, and a firewall that lets 443 in.

4 causes, each with a fix

Servers

AWS CLI says you must specify a region

You must specify a region. You can also configure your region by running "aws configure".

The AWS CLI sends every request to one region and has none to use.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.