Membrane API Gateway returns 500 Internal Server Error when the APIsJSON plugin fails to build the APIs.json document that lists the APIs of the gateway. The error comes from a bug in Membrane or from unexpected data in the configured APIs, not from the client.
The response contains the status 500 Internal Server Error, a detail such as Could not create APIs JSON!, 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.
With the detail Could not create APIs JSON!, writing the generated JSON document failed. The document consists only of values built by Membrane, so this should not happen in practice. If it does, it indicates a bug in Membrane.
The same link is also used when the APIsJSON 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.
A known trigger is an OpenAPI document without an info object: the plugin reads the title and version of every API from it.
info object with title and version.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:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.