cancel
Showing results for 
Search instead for 
Did you mean: 

CAP-consuming on-premise OData service : read ECONNRESET error

I533303
Advisor
Advisor
0 Kudos

Hi Experts,

I’m trying to consume an on-premise OData service inside the CAP App and I’m getting “ Error during request to remote service: read ECONNRESET “ when reading the entity as you can see below

I’m using Hybrid testing by binding XSUAA, Destination and connectivity services to the application. Following are the project elements:

1.Service definition : 2.Package Json:

  1. DEV 1 destination:

FYI :

  • I have tried to use another OData service and I’ve got the same error
  • I get the same error using another destination “DEV” with HTTPS configured in the Cloud connector, this destination is used by Fiori APP on BTP and it is working fine

  • I have tried to deploy the App to check if the issue is only with local testing via hybrid mode but I still get the same issue as you can see below

Please Do you have any suggestions of how to overcome this issue?

Thank you and best regards,

Mariam

rcaziraghi
Participant
0 Kudos

Hello!

I encountered the exact same issue, and the only solution I found was through using "Storyboard". Instead of importing the .edmx file and configuring it, I simply added a new external resource via the storyboard visual tool (using the "Open Storyboard" command). This method unexpectedly listed all services and entities without any problems. Additionally, I configured the development destination by adding it to the "default-env.json".

This situation is peculiar because, beyond just listing services and entities, the curl test with the specified destination also worked. The SAP Knowledge Base Article 3112360 - 502 error connecting to backend OData from CAP project in BAS wasn't particularly helpful. Even after completing all the necessary configurations, I still had to use the "cds watch" command, otherwise I would have binding issues.

If you, or anyone else for that matter, discover another method to resolve this issue, please let me know.

Best regards,

Rafael

View Entire Topic
ManolV
Advisor
Advisor
0 Kudos

Hi Mariam,

Looking in the error messages, both are with HTTP 502 "Bad Gateway" status code, however, the exact string message differs a bit: 1. read ECONNRESET vs 2. Failed to load destination. These are basically two distinct problems.

I'd suggest taking a look at SAP Knowledge Base Article 3112360 - 502 error connecting to backend OData from CAP project in BAS.

In addition, I'd also suggest to take a closer look in each of the steps as suggest by CAP and try inspecting further.

See also the answer by Gregor Wolf in this article: https://answers.sap.com/questions/13584230/cap-multitenancy-connectivity.html

Regards,
Manol

I533303
Advisor
Advisor

Hi manolvalchev,

Thanks for your inputs I have added the .env file with the configuration mentioned in the SAP Note you have shared and I could reach the On-premise Odata service successfully.

Thank you for your support,

Mariam

diego_renzi
Discoverer
0 Kudos

Hi Miriam,
can you share the solution pleas?

I can't open the documentation , it gives me HTTP request failed

0 Kudos

Hi manolvalchev,

unfortunately, I don't quite understand the solution in connection with the article on hybrid testing on the CAP page.

We have the destination service and the connectivity service in use and therefore two cases:

1. Connection to another oData service on the BTP (destination only)

2. Connection to e.g. an external API (Jira) (destination + connectivity)

We now want to debug the app locally and since we are accessing the services we would be in the hybrid testing scenario (https://cap.cloud.sap/docs/advanced/hybrid-testing) as I understand it.

Here we should bind the services with the command cds bind -2.

I have also done that and can connect with to the oData service (destination only), connecting via the connectivity service I get the error mentioned. In this case cds-watch was executed.

The article says that cds-watch does not use the BAS proxy and I suspect that is why I get the error.

Unfortunately, I don't understand how to apply the solution with the .env file and the proxy in this case - I use the .cdsrc-private.json through cds bind.

Unfortunately, when I execute cds run, I get an error with the xsuaa server (we bound the xsuaa Service with cds bind -2):

Error: Authentication kind "xsuaa" configured, but no XSUAA instance bound to application. Either bind an IAS instance, or switch to an authentication kind that does not require a binding.

thanks and best regards,
Philipp

rcaziraghi
Participant
0 Kudos

Hello!

I encountered the exact same issue, and the only solution I found was through using "Storyboard". Instead of importing the .edmx file and configuring it, I simply added a new external resource via the storyboard visual tool (using the "Open Storyboard" command). This method unexpectedly listed all services and entities without any problems. Additionally, I configured the development destination by adding it to the "default-env.json".

This situation is peculiar because, beyond just listing services and entities, the curl test with the specified destination also worked. The SAP Knowledge Base Article 3112360 - 502 error connecting to backend OData from CAP project in BAS wasn't particularly helpful. Even after completing all the necessary configurations, I still had to use the "cds watch" command, otherwise I would have binding issues.

If you, or anyone else for that matter, discover another method to resolve this issue, please let me know.

Best regards,

Rafael