Membrane API Gateway reports 500 Internal Server Error with the title Could not resolve file when the web-server component cannot load a file it should return. This error is rare: the component is used this way only by the wsdlPublisher plugin, when it loads the published WSDL or a schema that the WSDL references.
The error contains the status 500 Internal Server Error, the title Could not resolve file, the problem type https://membrane-api.io/problems/internal and a link to this page. In development mode, the path field shows the file that could not be resolved. 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.
Clients often do not see this response directly. The wsdlPublisher labels the error document as XML and runs the WSDL rewriter over it, which then fails. The client therefore usually receives the WSDL rewriting error instead. The underlying problem is the same missing file.
The wsdl of the wsdlPublisher, or the WSDL of the enclosing soapProxy, points to a file or URL that does not exist or cannot be read at request time.
A schema that the WSDL imports or includes through schemaLocation cannot be resolved.
The same link also appears when the webServer plugin throws an exception that it does not turn into an error response itself. Membrane then aborts the exchange with 500 Internal Server Error, and the detail reads Aborting! Exception caused in web-server during … flow. with the request URI and the flow. Membrane logs every occurrence with the full stack trace. Unless the exception points to your configuration or to the message content, this usually indicates a bug in Membrane.
wsdl location and every schemaLocation it references. Relative paths are resolved against the directory of the configuration file.path field of the response shows the failing path.webServer, check the gateway log and report the problem with the stack trace on GitHub Issues.A wsdlPublisher with a WSDL next to the apis.yaml looks like this:
api:
port: 2000
flow:
- wsdlPublisher:
wsdl: city-service.wsdl
api:
port: 2000
flow:
- wsdlPublisher:
wsdl: city-service.wsdl
All schema files that city-service.wsdl references must be available relative to the WSDL.
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.
If the plugin is nested inside a request, response or abort element and fails with an unexpected exception there, the exception message, the stack trace and the link to this page are currently sent even in production mode. Fix the failing plugin rather than relying on production mode to hide them.
Configuration reference:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.