Membrane API Gateway returns 500 Internal Server Error with the detail Could not create uri when the webServer plugin cannot parse the request URI. 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 Could not create uri, the problem type https://membrane-api.io/problems/internal and a link to this page. In development mode, it also contains the message of the URI parser, including the position of the bad character. Although the type is internal, the cause is usually the request URI sent by the client. In production mode, the title is replaced by Internal Server Error and the details are left out.
The plugin parses the destination of the exchange to find the requested document. In an API without a target, the destination is the raw request URI that the client sent.
The request path or query contains characters that are not allowed in a URI and are not percent-encoded, for example |, {, }, ^, " or <. Membrane's URI parser rejects them unless illegal characters are explicitly allowed.
The request line contains a malformed percent-escape, such as %G1, or another URI syntax error.
| as %7C.configuration:configuration:
uriFactory:
allowIllegalCharacters: true
configuration:
uriFactory:
allowIllegalCharacters: true
This setting weakens URI validation for all APIs of the gateway. Use it only when you cannot fix the clients.
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.