Membrane API Gateway returns 500 Internal Server Error with the detail Error serving document when the webServer plugin hits an I/O error while it serves a document in the request flow. The same applies to components built on it: adminConsole and the login dialogs of login and oauth2authserver.
The response contains the status 500 Internal Server Error, the detail Error serving document, 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.
The webServer plugin serves static files from a directory, and can generate a directory index. A missing file does not lead to this error: it gets a 404 Not Found.
In the current version of Membrane, none of the built-in file resolvers produces the kind of I/O error that leads to this response. This error is therefore very rare. If it occurs, it points to an unexpected internal state, for example while listing a directory for a generated index (generateIndex: true), and usually indicates a bug in Membrane.
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 ---. 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.
Configuration reference:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.