Membrane API Gateway returns 500 Internal Server Error with the detail Error handling OpenAPI overview! when the OpenAPI publisher fails while it serves the overview under /api-docs or a single document at /api-docs/<id>. An OpenAPI document with missing parts or an invalid server URL is the usual cause.
The response contains the status 500 Internal Server Error, the title Internal server error., the detail Error handling OpenAPI overview!, the problem type https://membrane-api.io/problems/internal and a link to this page. 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.
For an api with openapi specs, Membrane publishes the documents under /api-docs. The overview lists all documents as JSON, or as HTML when the Accept header contains html. A single document at /api-docs/<id> is returned with its server URLs rewritten to point to the gateway. See API docs publisher for details.
An OpenAPI document has no info section, or info has no title or version. Building the JSON overview then fails. Every document needs at least:
openapi: 3.0.3
info:
title: Fruit Shop API
version: 1.0.0
servers:
- url: https://api.predic8.de/shop/v2openapi: 3.0.3 info: title: Fruit Shop API version: 1.0.0 servers: - url: https://api.predic8.de/shop/v2
A servers[].url in the document, or the value that the rewrite settings produce from it, is not a valid URI. Rewriting the document for /api-docs/<id> then fails.
Rewriting the server URLs needs the Host header of the request. A client that sends none, which is possible with HTTP/1.0, causes this error for /api-docs/<id>.
An error occurred while Membrane rendered the HTML overview for a request with an Accept header containing html.
Any other exception that the openapiPublisher plugin does not turn into an error response itself is reported under the same 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 or to the message, this usually indicates a bug in Membrane.
info.title, info.version and valid servers[].url values.rewrite settings (host, port, protocol, basePath) of the openapi spec.Host header.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.