Membrane API Gateway returns 500 Internal Server Error with a link to this page when the return plugin cannot build the response it sends back to the client. This is rare and usually indicates a bug in Membrane.
The response contains the status 500 Internal Server Error, the title Internal server error., the problem type https://membrane-api.io/problems/internal and a link to this page. The detail is either Could not create response! or, more likely, Aborting! Exception caused in … flow. In development mode, the exception message is included as well. The type internal means that the gateway could not complete the processing of the exchange. In production mode, the title is replaced by Internal Server Error and the details are left out.
The return plugin ends the flow and sends a response to the client without calling a backend. It uses the response that earlier plugins created, or builds one from the request, with the configured status and contentType.
An unexpected exception inside return is reported under this URL by Membrane's generic error handler. The detail then reads Aborting! Exception caused in … flow. and names the plugin, the request URI and the flow. Unless the exception points to your configuration, this usually indicates a bug in Membrane.
The detail Could not create response! belongs to an error branch that the current code does not reach in practice. If you see it, treat it as a bug in Membrane.
If the request body cannot be read while return uses it for the response, Membrane reports a body read error with a different URL, not this one.
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 ---. The title then reads Internal Server Error, and instead of the details the response only contains a log key. Search the gateway log for this key to find the exception.
If the plugin is nested inside a request, response or abort element and throws an unexpected exception, the exception message, the stack trace and the link to this page are currently sent even in production mode. Fix the failing plugin rather than relying on production mode to hide them.
Configuration reference:
Tutorials with runnable examples:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.