Membrane API Gateway returns 503 Service Unavailable when the balancer plugin cannot choose a backend node for the request. No backend is contacted. Usually no node is available, which is a backend or configuration problem. Less often, the dispatching strategy or the session id extraction failed.
The response contains the status 503 Service Unavailable, the title Service unavailable, the problem type https://membrane-api.io/problems/internal and a link to this page. The type internal means that the gateway failed while processing the exchange. Two cases share this link.
The detail reads No backend node found that is ready to handle this request. The cluster has no node with status UP.
The detail reads Could not get dispatched node! The strategy or a session id extractor failed while selecting the node.
The balancer plugin distributes requests over the nodes of a cluster. It only considers nodes with status UP. With several clusters, it uses the cluster named Default:
api:
port: 2000
flow:
- balancer:
clusters:
- name: Default
nodes:
- host: node1.example.com
port: 8080
- host: node2.example.com
port: 8080
api:
port: 2000
flow:
- balancer:
clusters:
- name: Default
nodes:
- host: node1.example.com
port: 8080
- host: node2.example.com
port: 8080
No node in the cluster has status UP. Nodes are taken out of rotation by the balancerHealthMonitor, by the admin console or by clusterNotification messages, or they were never added.
The cluster exists, but contains no nodes.
More than one cluster is configured under clusters and none of them is named Default. The balancer looks up the cluster named Default, which is then created empty.
With byThreadStrategy, every node already handles maxNumberOfThreadsPerEndpoint requests, and none became free after five waits of retryTimeOnBusy milliseconds. The exception message is All available servers are busy.
A configured session id extractor (xmlSessionIdExtractor, jSessionIdExtractor or sessionIdExtractor) failed on the request, for example because of a malformed XML body or an expression error.
balancerHealthMonitor. Bring at least one node back UP.clusters configuration: add nodes, and name the cluster Default if you use several clusters with a single balancer.byThreadStrategy, raise maxNumberOfThreadsPerEndpoint or retryTimeOnBusy, or add nodes.Clients can retry later.
By default, Membrane runs in development mode and adds details to error responses that help you find the problem, including the link to this page. 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 ---.
In production mode, the title of this error is replaced by Internal Server Error, and the response only says Internal details are hidden. See server log (key: ...). Search the gateway log for that key to find the full error message.
Configuration reference:
balancerclustersclusternodebalancerHealthMonitorbyThreadStrategyxmlSessionIdExtractorjSessionIdExtractorsessionIdExtractorStill stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.