Membrane API Gateway returns 500 Internal Server Error with the message Could not read the message body. when the template plugin cannot read a message body that is not the client's request. Usually it is the response of the backend.
The response contains the status 500, the problem type https://membrane-api.io/problems/internal and a link to this page. The type internal means that the problem is on the gateway side, usually the backend. In production mode, the title is replaced with Internal Server Error.
The backend closed the connection early or sent a truncated or malformed response body, for example with bad chunked framing or fewer bytes than its Content-Length.
The backend response is labelled Content-Encoding: gzip, deflate or br, but the body is not valid in that format.
A streaming body, for example from sseDemoStream, cannot be read completely. Combined with a plugin that reads the body, it fails with Streaming body cannot be materialized. Remove the plugin from that API.
curl -v, and inspect its response body and headers.Content-Length, chunked framing and Content-Encoding.openapi plugin, no log entry is written.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 ---.
Configuration reference:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.