Open Source API Gateway

500 Internal Server Error: Admin Console REST API Failed

Membrane API Gateway returns 500 Internal Server Error with the detail Error dispatching request! when the REST API of the admin console cannot answer a request.

The Error Response

The response contains the status 500 Internal Server Error, the detail Error dispatching request!, the problem type https://membrane-api.io/problems/internal and a link to this page. The type internal means that the gateway could not complete the processing of the message. In production mode, the title is replaced by Internal Server Error and the details are left out.

What the Admin REST API Does

The adminConsole shows the APIs, exchanges and statistics of the gateway in the browser. Its pages load their data from a REST API that is part of the admin console.

Common Causes

The Query String Cannot Be Parsed

A query parameter appears more than once or has no =.

An Invalid Number in the URL

An exchange ID or the waitForModification value in the URL is not a valid number.

The Exchange Store Failed

The store that keeps the recorded exchanges failed while the request was answered.

An Unexpected Exception in the Plugin

The same link also appears when the adminConsole plugin throws an exception that it does not turn into an error response itself. Membrane then aborts the exchange with 500 Internal Server Error, and the detail reads Aborting! Exception caused in admin-rest during … flow. with the request URI and the flow. Membrane logs every occurrence with the full stack trace. Unless the exception points to your configuration or to the message content, this usually indicates a bug in Membrane.

How to Fix It

  1. Client side: use the admin console pages, or send the request without repeated or malformed query parameters and with numeric IDs.
  2. For any other cause, check the gateway log and 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. 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 ---. The title then reads Internal Server Error, and the details and the link to this page are left out. If the response contains a log key, search the gateway log for it to find the full error message.

If the plugin is nested inside a request, response or abort element and fails with an unexpected exception there, 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.

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.