Dear experts,
Lets first explain what i am trying to achieve. In the end i want to build an SAP CAP application with a SAP Fiori Elements front end. I started with building an MTA app with approuter, which uses the sap btp connectivity service and the destination service to connect with an on premise s4hana system through destinations configured in the btp and via the cloud connector. However, after configuring the approuter, and then accessing the app through the approuter in local deployment, i get an ECONNRESET error message. Let me walk you through my exact configurations and actions:
./mta.yaml
in the rootfolder, in mta.yaml i configure an srv module and approuter. Both are bound to the xsuaa, connectivity and destination service:


./app/xs-app.json
2 main sources are defined. "/app/" requests are forwarded to the local frontend code files, while "/sales-orders/" requests are forwarded to the backend destination "MYBRAND_S4A_2" destination. This destination is defined on "space" level in the sap BTP, as well as on subaccount level. In the app, we want to consume the api_sales_orders_srv api odata service.

This destination has also been configured in de ./package.json file, for the CAP application:

The BTP destination, connectivity and auth services are bound in ./cdsrc-private.json (apiEndpoint and org have been removed in this example):

Now, when i start the approuter, i see in the console that it is using the services from .cdsrc-private.json:
i execute:
cds bind --exec -- npm start --prefix app
terminal output:


Now when i open port 5000, i get the following output:
#2.0#2022 12 06 09:08:55:525#+00:00#INFO#/Auth/OAuth2#####69660390-0d47-4714-8c1e-e53221ff1031####dh6mIGWbkf-ZlvwSKbFKYcRneR9zMQUt######69660390-0d47-4714-8c1e-e53221ff1031#PLAIN##query does not exist for request url /app/webapp/webapp/index.html#
#2.0#2022 12 06 09:08:55:525#+00:00#INFO#/Auth/OAuth2#####69660390-0d47-4714-8c1e-e53221ff1031####dh6mIGWbkf-ZlvwSKbFKYcRneR9zMQUt######69660390-0d47-4714-8c1e-e53221ff1031#PLAIN##sending page with client-side redirect to https://kennisteam-development-8c7zk715.authentication.eu10.hana.ondemand.com/oauth/authorize?response_type=code&client_id=sb-projectroot!t151690&redirect_uri=https%3A%2F%2Fport5000-workspaces-ws-sg29f.eu10.applicationstudio.cloud.sap%2Flogin%2Fcallback#
#2.0#2022 12 06 09:08:55:525#+00:00#INFO#/Auth/OAuth2#####69660390-0d47-4714-8c1e-e53221ff1031####dh6mIGWbkf-ZlvwSKbFKYcRneR9zMQUt######69660390-0d47-4714-8c1e-e53221ff1031#PLAIN##x-forwarded-path header: undefined#
#2.0#2022 12 06 09:08:56:697#+00:00#ERROR#/Handler#####1fa1c886-b77c-4a2b-a9db-83c3ee9e9961####phP1esiDRaNaO8YsQoUDRPyOnOmRzyPa######1fa1c886-b77c-4a2b-a9db-83c3ee9e9961#PLAIN##GET request to /webapp/webapp/Component-preload.js completed with status 404 ENOENT: no such file or directory, stat '/home/user/projects/projectroot/app/webapp/webapp/Component-preload.js'#
#2.0#2022 12 06 09:08:56:719#+00:00#ERROR#/Handler#####b743ae56-4f91-4223-ab67-814fcb0b06c0####phP1esiDRaNaO8YsQoUDRPyOnOmRzyPa######b743ae56-4f91-4223-ab67-814fcb0b06c0#PLAIN##GET request to /webapp/webapp/Component-preload.js completed with status 404 ENOENT: no such file or directory, stat '/home/user/projects/projectroot/app/webapp/webapp/Component-preload.js'#
#2.0#2022 12 06 09:09:06:913#+00:00#ERROR#/Handler#####53ce673b-2fee-44e5-82c8-cfc026743e64####phP1esiDRaNaO8YsQoUDRPyOnOmRzyPa######53ce673b-2fee-44e5-82c8-cfc026743e64#PLAIN##GET request to /sales-orders/$metadata?sap-language=NL completed with status 502 error while forwarding request to http://virtualport:9999/sap/opu/odata/sap/api_sales_orders_srv/$metadata?sap-language=NL: read ECONNRESET correlation_id = 53ce673b-2fee-44e5-82c8-cfc026743e64#
#2.0#2022 12 06 09:09:06:933#+00:00#ERROR#/Handler#####d75ca45c-d2d5-4cca-8ca1-5f8effb367d1####phP1esiDRaNaO8YsQoUDRPyOnOmRzyPa######d75ca45c-d2d5-4cca-8ca1-5f8effb367d1#PLAIN##HEAD request to /sales-orders/ completed with status 502 error while forwarding request to http://virtualport:9999/sap/opu/odata/sap/api_sales_orders_srv/: read ECONNRESET correlation_id = d75ca45c-d2d5-4cca-8ca1-5f8effb367d1#
It says that the /sales-orders/ call is forwarded to virtualport:9999/sap/opu/odata/sap/api_sales_orders_srv/
virtualport:9999 is the url defined in de destination in the btp, which points towards the cloud connector.
In the cloud connector, in ljs_trace.log this is the only Warning message that pops up, but errors are not shown:
022-12-06 10:09:11,253 +0100#WARN#com.sap.ui5.resource.ResourceServlet#https-jsse-nio2-8443-exec-1# #[404] "/resources/sap-ui-version.json": Service=30ms, Find=30ms Reason: Resource could not be found!
Does anybody see what is going wrong here, because i don't really know how to troubleshoot this anymore.
Your help is appreciated!