Open Source API Gateway

500 Internal Server Error: No Response Was Generated

Membrane API Gateway returns 500 Internal Server Error with the detail No response was generated by the interceptor chain. when the plugin chain for an HTTP/1.x request finishes without a response. Membrane has nothing to send back to the client.

The Error Response

The response contains the status 500 Internal Server Error, the detail No response was generated by the interceptor chain., 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.

Why a Response Can Be Missing

Normally, the response comes from the backend or from a plugin such as return or a script. A plugin can also end the flow early. If it does so without setting a response, the chain ends empty and Membrane answers with this error. For HTTP/2 requests, the same situation is reported as internal/http2-exchange-handler.

Common Causes

A Script Returned Without a Response

A groovy or javascript script, or a custom Java plugin, returned RETURN or ABORT without setting a response, or removed the response, e.g. with exc.setResponse(null).

A Plugin of an Internal API Failed

A plugin inside an API reached through an internal:// target threw an exception. The internal routing then aborts without a response.

A Statistics Request Lacks Parameters

A statisticsProvider request is missing one of the query parameters offset and max, or has a non-numeric value. The plugin aborts without a response in that case, and also when reading the statistics from the database fails.

A Built-In Plugin Ended the Flow

If none of these apply, a built-in plugin ended the flow without a response, which is a bug in Membrane.

How to Fix It

  1. Operator: in scripts, set a response before returning Outcome.RETURN or Outcome.ABORT, or return a Response object, which Membrane sets for you. See scripting with Groovy, JavaScript and SpEL.
  2. Operator: the log line Interceptor chain returned no response (path=..., flow=...) shows the path and the chain. For internal:// routes, look for the preceding exception of the internal API's plugin in the log (debug level, Error from interceptor ...).
  3. Client: call statisticsProvider with numeric offset and max parameters.
  4. Otherwise, report it with the configuration and the log on GitHub Issues.

Hide Details in Production

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: true
configuration:
  production: true

Add the configuration document to your apis.yaml and separate it from the APIs with ---.

Related Documentation

Configuration reference:

← All Membrane error messages

Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.