cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP: Error during request to remote service, timeout of 10000ms exceeded

MMonis
Explorer
0 Kudos

We have a SAP CAP service, which connects to SAP SuccessFactors to post/upsert data to SF.

The error is "statusCode":502,"reason":{"message":"Error during request to remote service: \ntimeout of 10000ms exceeded","name":"AxiosError","config":{"timeout":10000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"proxy":false,"method":"post"

The error occurs in situations where we post a larger chunk of data to SAP SF, and the response from SAP SF takes more than 10000ms. It seems the SAP CAP service doesn't wait beyond 10000ms for a response back from SAP SF, and then just throws the above error. It works fine if SAP SF comes back with a response within this time. If we try through postman, this works fine with a large chunk of data.

We are using a SAP BTP destination for connectivity to SAP SF and have maintained the config in the packgage.json as 

 

 

...
"cds": {
        "requires": {
            "sf_tech": {
                "kind": "odata",
                "model": "srv/external/sf-tech",
                "credentials": {
                    "destination": "SFTech",
                    "requestTimeout": 80000 // also tried 30000
                }
            }
        }
}
...

 

 

The SAP CAP service code that triggers the post/upsert to SAP SF is 

 

 

import { Request, Service } from "@sap/cds";
...
const headers = {
      MaxDataServiceVersion: this.dataServiceVersion,
      "Content-Type": `multipart/mixed; boundary=${batchId}`,
    };
let response = await (this.service as Service)
        .transaction(this.request)
        .send("POST", "/$batch", this.batchBody as String, headers);
...

 

The app is deployed to sap cloud foundry and the btp destination from above is also configured and maintained.

Does anyone know where to increase/set the timeout beyond 10000ms ?

Regards,

Mel

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Dinu
Contributor

You seem to be using @Sap-cloud-sdk/http-client@2. Upgrade to @Sap-cloud-sdk/http-client@3

Answers (0)