Membrane API Gateway returns 500 Internal Server Error with this page when a request is routed to an internal:// target and Membrane cannot hand it to the internal API it names. The cause is usually the gateway configuration.
The response contains the status 500 Internal Server Error, the problem type https://membrane-api.io/problems/internal and a link to this page. In development mode it also contains the exception message, e.g. No api found for destination .... The type internal means that the gateway could not complete the processing of the request. In production mode, the title is replaced by Internal Server Error and the details are left out.
An API can forward a request to another API in the same gateway instead of a backend. The target url is then internal:// followed by the name of the other API:
api:
port: 2000
target:
url: internal://shop
---
internal:
name: shop
flow:
- return:
status: 200
api:
port: 2000
target:
url: internal://shop
---
internal:
name: shop
flow:
- return:
status: 200
No API has exactly the name in the internal://<name> target. The comparison is case-sensitive, so internal://Shop does not find an API named shop. The exception reads No api found for destination ....
The name refers to a proxy such as proxy, sslProxy or stompProxy, which cannot be the target of internal routing. The exception reads Not a service proxy: ....
A ${...} expression in the target url inserted spaces or other illegal characters, so the internal:// destination cannot be parsed.
An unexpected exception while following a chain of internal targets is rare and usually indicates a bug in Membrane. An exception thrown by a plugin of the internal API is not reported here: the internal routing aborts without a response, which shows up as internal/http-handler/no-response-produced.
internal:// matches the name of an internal API or another service API in the same configuration, including upper and lower case.url is built from an expression, check that the result is a valid URI.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 response then only contains a log key. Search the gateway log for this key to find the exception.
Configuration reference:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.