Membrane API Gateway returns 500 Internal Server Error with the detail Error generating OpenAPI overview! when the apiDocs plugin fails to build the API overview or a single OpenAPI document. The cause is usually one of the OpenAPI documents served by the gateway, sometimes a bug in Membrane. The client did nothing wrong.
The response contains the status 500 Internal Server Error, the detail Error generating OpenAPI overview!, 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.
The apiDocs plugin answers with an HTML or JSON overview of all APIs deployed from OpenAPI documents, and it serves each document on its own. Requests for the Swagger UI under /api-docs/ui/ do not produce this error.
When a single OpenAPI 3 document is requested, Membrane rewrites every servers[].url to the address of the gateway. A server URL that is not a valid URI makes this fail, and so does a servers entry without a url.
The JSON overview, which is returned when the Accept header does not contain html, reads info.title and info.version from every document. A document without an info object fails here.
Rendering the template of the HTML overview failed. This is rare and usually indicates a bug in Membrane.
error level.openapi elements of your APIs. Each needs info with title and version, and every servers entry needs a valid url:openapi: 3.0.3
info:
title: Shop API
version: 1.0.0
servers:
- url: https://api.example.com/shop/v2
paths: {}
openapi: 3.0.3
info:
title: Shop API
version: 1.0.0
servers:
- url: https://api.example.com/shop/v2
paths: {}
If the documents are valid, report the problem with the stack trace on GitHub Issues.
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.