506

Variant Also Negotiates

5xx Server Error

ELI5

The server got confused while picking the best version of a resource and ended up pointing in circles.

Server perspective

Use 506 for a transparent content negotiation misconfiguration where the selected variant is itself negotiable and causes a loop or invalid resolution path.

When to use

  • Return 506 only for transparent content negotiation configuration errors
  • Use it when the server cannot deliver a concrete representation because variant metadata is self-referential
  • Transparent content negotiation is enabled and the selected variant is also negotiable
  • Server configuration creates a circular variant selection path
  • Negotiated representations cannot be resolved because the variant map is self-referential

How to respond

  • Fix the variant map, rewrite rules, or negotiated-resource metadata so each negotiable resource resolves to concrete variants
  • Log which variant selection path caused the loop so operators can repair the configuration quickly

Headers to consider

  • No status-specific header is required; standard negotiation headers may still appear, but the main fix is server-side configuration

Response body

  • A body is helpful; explain that content negotiation configuration is invalid and include a request or trace ID for support

Server-side pitfalls

  • Do not use 506 for ordinary Accept or Accept-Language mismatches; that is usually 406 Not Acceptable
  • Do not blame the client for a server-side negotiation loop
  • The client asked for an unavailable representation and the server can describe acceptable alternatives (use 406 Not Acceptable)
  • The server hit a generic unexpected fault unrelated to negotiation configuration (use 500 Internal Server Error)
  • Multiple valid variants exist and the server wants the client to choose (use 300 Multiple Choices)

Examples

Misconfigured negotiated variant

Request:GET https://api.example.test/manual
Response:506 Variant Also Negotiates # Headers Content-Type: application/json # Body { "error": "variant_also_negotiates" }

The server's negotiated French variant points to another negotiable resource instead of a concrete representation.

References

Related Status Codes