Skip to content

Sporadic 405 Not Allowed errors #157

@zstadler

Description

@zstadler

A lightly-loaded overpass container occasionally returns 405 Not Allowed errors for relatively simple POST queries.

According to Gemini, this is most likely a "Keep-Alive" race condition:

This is a notorious issue with Nginx (which Overpass uses) and Docker load balancers.

  • The Mechanism: The client (or an intermediate proxy) attempts to reuse an idle TCP connection (Keep-Alive) to send a new POST request.
  • The Failure: Simultaneously, the Overpass server decides the connection has been idle too long and closes it (sends a TCP FIN or RST).
  • The Result: The Load Balancer/Proxy detects the closed connection while trying to forward the data. For GET requests, it would typically retry or return a 502/504. However, because POST is not idempotent (retrying it could duplicate data/action), Nginx defaults to returning a 405 Method Not Allowed or sometimes a generic 400-level error instead of retrying.
  • Fix: Adjust the keepalive_timeout in your Nginx config to be slightly higher than the client's/load balancer's timeout, or disable keep-alive for the upstream CGI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions