Utilo

HTTP 506 Variant Also Negotiates – Free, Online, Private

506 Variant Also Negotiates means a transparent content negotiation choice was itself a negotiable resource.

What HTTP 506 means

506 is from RFC 2295 on transparent content negotiation. It means the server chose a variant, and that variant is configured to negotiate, so the negotiation has no end. It is a server configuration error. The client cannot fix it by changing Accept. Ordinary APIs that do not implement transparent content negotiation should not return 506.

506 Variant Also Negotiates belongs to the 5xx server error class. Clients that only look at the class will group it with its neighbors. Clients that care about the exact code should use the narrower rule on this page, because the class is only the first digit.

When you see HTTP 506

When you see HTTP 506 Variant Also Negotiates, stop on that exact status line. 506 Variant Also Negotiates means a transparent content negotiation choice was itself a negotiable resource. The trace that usually produces it: A negotiated resource listed a variant that was itself negotiated. The 5xx server error class only tells you the first digit. A neighbor in that class is a different fault, and the fix on this page does not transfer to it.

Return 506 only if you implement transparent content negotiation and you detect a variant that points back at negotiation. If you do not implement that specification, do not borrow the code for a generic loop. A redirect loop is not 506. Fix the variant configuration. The client has nothing useful to change.

How to fix HTTP 506

To fix HTTP 506, change the condition that made the server choose Variant Also Negotiates. Do not retry. Report the error. There is no request edit that repairs the server's variant configuration. No. The next attempt hits the same configuration. If the log line is a different code, leave this page. The mix-up people make with 506 is this one: A redirect loop is a chain of 3xx responses, not 506. 406 is a negotiation that failed to find any variant. 506 is a negotiation that found a variant which starts negotiation again.

  • A misconfigured alternate pointed at the same URL.
  • A client retried with a different Accept and still received 506, because the bug is server-side.
  • An API reused 506 to mean 'we negotiated ourselves into a corner' without implementing RFC 2295.

An access log that only stores 506 is not enough to tell these apart. Keep the method, the path, and a request id. Do not keep the Authorization header or a request body that might be a token. The status explains the outcome. It is not a place to echo secrets back to the client either.

Example response

HTTP 506 Variant Also NegotiatesHTTP/1.1 506 Variant Also Negotiates

The status is the configuration bug. The operator fixes the variant list so a chosen representation does not negotiate again. The client can only report the error. Changing Accept headers will not select a variant the server can finish choosing.

What the client should do

Do not retry. Report the error. There is no request edit that repairs the server's variant configuration.

Do not cache 506 as a representation. There is no finished variant.

No. The next attempt hits the same configuration.

Codes people confuse with HTTP 506

A redirect loop is a chain of 3xx responses, not 506. 406 is a negotiation that failed to find any variant. 506 is a negotiation that found a variant which starts negotiation again.

Frequently asked questions

Will a normal JSON API see 506?

No, unless it implements transparent content negotiation and misconfigures it.

Can the client fix 506?

No. The variant configuration on the server is wrong.

How is 406 different?

406 means nothing acceptable was found. 506 means a choice was found and that choice negotiates again.

Is a redirect loop a 506?

No. Redirect loops are repeated 3xx responses.

What should I do first when I see HTTP 506?

Read the status as 506 Variant Also Negotiates specifically. 506 Variant Also Negotiates means a transparent content negotiation choice was itself a negotiable resource. Then check the cause that matches the request you sent, starting with: A negotiated resource listed a variant that was itself negotiated.