Open Source API Gateway

500 Internal Server Error: Error Creating OpenAPI Publisher

Membrane API Gateway returns 500 Internal Server Error with the detail Error creating OpenAPI publisher! when the apiDocs plugin cannot create the publisher that renders the API overview and the Swagger UI. This points to a broken installation or a bug in Membrane, not to the client or to your OpenAPI documents.

The Error Response

The response contains the status 500 Internal Server Error, the detail Error creating OpenAPI publisher!, 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.

What the apiDocs Plugin Does

The apiDocs plugin publishes an overview of the APIs deployed from OpenAPI documents, together with a Swagger UI. See API Docs Publisher. The HTML for these pages comes from two templates that ship inside the Membrane jar. When the publisher is created, both templates are loaded and compiled.

Common Causes

The Templates Are Missing

The template resources /openapi/swagger-ui.html or /openapi/overview.html are not on the classpath, for example because the Membrane jar was repackaged or trimmed.

The Template Engine Failed

The Groovy template engine that compiles the templates could not load or compile them, for example because a library is missing from the classpath.

How to Fix It

  1. Check the gateway log. Membrane logs the full exception at error level.
  2. Use an unmodified Membrane distribution. If you build your own package, make sure the openapi resources are included.
  3. If the installation is intact, report the problem with the stack trace 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, including the link to this page. 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 ---.

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.

Related Documentation

Configuration reference:

Tutorials with runnable examples:

← All Membrane error messages

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