Membrane API Gateway returns 504 Gateway Timeout with this page when the HTTP client that forwards to the target cannot set up a connection to the backend in time. No request was sent to the backend. The backend, the network, or a timeout that is too short is to blame.
The response contains the status 504 Gateway Timeout, the title Gateway Timeout, the problem type https://membrane-api.io/problems/internal and a link to this page. The type internal means that the gateway could not complete the processing of the request. In production mode, the title is replaced by Internal Server Error and the details are left out.
If the connection was set up but the backend did not answer in time, see socket timeout instead.
The backend host does not answer the TCP connection attempt within the connect timeout (timeout, default 10000 ms), e.g. because a firewall drops packets, the host is down, or the IP address is wrong.
The connection was open, but the CONNECT handshake with an outgoing HTTP proxy or the TLS handshake with the backend did not finish within the connect timeout.
The error is reported after the configured retries are used up. By default, connect timeouts are retried for every HTTP method, so the client may wait several times the connect timeout before it gets this response.
httpClientConfig to your network.configuration:
httpClientConfig:
connection:
timeout: 5000
retries:
retries: 2
delay: 100
retryOnConnectTimeout: true
configuration:
httpClientConfig:
connection:
timeout: 5000
retries:
retries: 2
delay: 100
retryOnConnectTimeout: true
Set retryOnConnectTimeout: false to stop retrying connect timeouts, so that the client gets the error sooner.
By default, Membrane runs in development mode and adds details to error responses that help you find the problem. These details may reveal information about your setup. In production, turn them off:
configuration:
production: trueconfiguration: production: true
Add the configuration document to your apis.yaml and separate it from the APIs with ---.
Configuration reference:
Tutorials with runnable examples:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.