Membrane API Gateway returns 500 Internal Server Error with the title Error performing callout. when the call plugin cannot complete its HTTP call to the configured url. The exchange is aborted. The cause is the called endpoint, the network, or the url of the plugin.
The response contains the status 500 Internal Server Error, the title Error performing callout., the problem type https://membrane-api.io/problems/internal and a link to this page. In development mode, it also contains the configured expression and the evaluated destination. The type internal means that the gateway failed while processing the exchange.
The call plugin sends an HTTP request to another endpoint in the middle of the flow and uses the answer, for example to fetch a token or enrich a message. The url may contain ${...} expressions. A 4xx or 5xx answer from the called endpoint is not an error. Its body is used like any other.
api:
port: 2000
flow:
- call:
url: https://auth.example.com/token
target:
url: https://api.example.com
api:
port: 2000
flow:
- call:
url: https://auth.example.com/token
target:
url: https://api.example.com
The host of the url cannot be resolved. The detail reads Unknown host ....
The connection is refused or times out, or the TLS handshake fails.
Currently, the call plugin uses its own HTTP client with default settings. A proxy configured in configuration.httpClientConfig is not applied to it, so endpoints that are only reachable through a proxy fail.
A ${...} expression in the url produced an empty or malformed value.
The same link is also used when the call plugin throws an exception that it does not handle itself. The detail then starts with Aborting! Exception caused in ... and names the flow. Membrane logs such exceptions at warn level with the stack trace. If the plugin is nested in request, response or abort, the exception message and stack trace are sent to the client even in production mode. Unless the exception points to your configuration or to the message content, this usually indicates a bug in Membrane.
expression and destination in the response.url.target, or make the endpoint reachable directly.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:
Tutorials with runnable examples:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.