Open Source API Gateway

500 Internal Server Error: Error Processing the Call Response

Membrane API Gateway returns 500 Internal Server Error with the detail Internal call when the call plugin gets a response from the called endpoint but cannot copy it into the current message. The body is read and decoded at this point, so the cause is usually the response of the called endpoint. The exchange is aborted.

The Error Response

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

Common Causes

The Response Body Is Incomplete

The called endpoint closed the connection before the response body was complete, or the chunked encoding of the body is broken.

The Content Encoding Is Invalid

The response declares a Content-Encoding such as gzip, deflate or br, but the body is not validly encoded that way.

An XOP or MTOM Message Cannot Be Reassembled

The response is an XOP/MTOM message whose parts cannot be put back together.

How to Fix It

  1. Check the gateway log. Membrane logs Error processing response from ... with the reason.
  2. Call the endpoint directly, for example with curl --compressed -v, and check that its response is complete and correctly encoded.
  3. Fix the called endpoint. If the problem persists with a correct response, report it 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.