SAP Builders Discussions
Join the discussion -- ask questions and discuss how you and fellow SAP Builders are using SAP Build, SAP Build Apps, SAP Build Process Automation, and SAP Build Work Zone.
cancel
Showing results for 
Search instead for 
Did you mean: 

Call web service error queryA ENOTFOUND

freyagiran23
Explorer
0 Kudos
374

It is something very simple but it is not working for me

I am calling the SAP business one web service to log in

here you can see that it works from postman

freyagiran23_0-1738676026732.png

but when I make the call from sap build it gives me an error

freyagiran23_1-1738676224319.png

Any comments, I feel a little frustrated because I haven't been able to move forward and I know it's something stupid that I'm missing

Please your help

 

 

9 REPLIES 9

freyagiran23
Explorer
0 Kudos
353

@TJe 

Good morning, excuse my boldness,

I saw that you have great experience with web services

Maybe you can help me, I would really appreciate it.

williamwachholz
Participant
332

Hello,

It seems to me that you cannot reach the server. It is the same machine that you run your test using postman?

Best regards

0 Kudos
323

Yes, it is the same machine, my browser is Google Chorme

Dan_Wroblewski
Developer Advocate
Developer Advocate
275

Can you publish the complete error from SAP Build Process Automation, and perhaps from Developer Tools?




--------------
See all my blogs and connect with me on Twitter / LinkedIn

0 Kudos
253

Yes, here it is in the project I only have three activities

freyagiran23_0-1738758951724.png

Custom Script

freyagiran23_5-1738759524316.png

custom code

let input = {
 "CompanyDB": "URGO_TEST",
    "Password": "xxxxxxxxx.",
    "UserName": "layer"
};
 
return {
    method: 'POST',
     responseType: 'json',
   // ignoreInvalidCookies: true,
    resolveBodyOnly: true,
    json: input,
   headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
    },
    //useWinCa: true,
    resetCookie: true,
   //rejectUnauthorized: false,
   https: { rejectUnauthorized: false },
   requestCert: false
};

 

Call Web Service

freyagiran23_2-1738759036004.png

Log Message

freyagiran23_3-1738759062393.png

 

The error is 

freyagiran23_4-1738759124242.png

Error Detail 1: "Login job started before irpa_core.request.call activity ended. Missing await ?"

{
    "type": "automationActivity",
    "name": "irpa_core.log",
    "label": "irpa_core.log",
    "inputs": [
        "Login job started before irpa_core.request.call activity ended. Missing await ?",
        {
            "key": "Error",
            "value": 1
        },
        null,
        true
    ]
}

Error Detail 2:  "queryA ENOTFOUND 45.163.29.123",

{
    "uid": "3cd6130c-349e-472e-a699-0dc36319efb2",
    "name": "Login",
    "type": "automation",
    "instanceUid": "ec71ec36-11bd-4c0d-8f4f-cccc3ddd663a",
    "packageUid": "b504d3f7-1568-4be2-aa7e-218ce6980df6",
    "packageVersionUid": "b55196a8-62af-4df2-8e64-47ef6df1e7f5",
    "attended": true,
    "duration": 22,
    "status": "Failed",
    "code": "KO",
    "label": "queryA ENOTFOUND 45.163.29.123",
    "parentInstanceUid": "cc6ace3f-b4b5-939c-4507-687b8f0ac6fd",
    "containerInstanceUid": "ec71ec36-11bd-4c0d-8f4f-cccc3ddd663a",
    "line": 2,
    "file": "bundle.js",
    "exception": "irpa_core.error.Error",
    "stack": "Error: queryA ENOTFOUND 45.163.29.123\n    at Object.b [as cast] (C:\\Users\\freya\\AppData\\Local\\SAP\\Intelligent RPA\\Projects\\fcbf6823-f7e1-44d8-b146-4ce402b60288\\dist\\bundle.js:2:210766)\n    at y.start (C:\\Users\\freya\\AppData\\Local\\SAP\\Intelligent RPA\\Projects\\fcbf6823-f7e1-44d8-b146-4ce402b60288\\dist\\bundle.js:2:290940)\n    at async Object.p [as startJob] (C:\\Users\\freya\\AppData\\Local\\SAP\\Intelligent RPA\\Projects\\fcbf6823-f7e1-44d8-b146-4ce402b60288\\dist\\bundle.js:2:284758)"
}

 

 

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
228

I don't that much about the Call Web Service activity, just what I know from using it with DMS. But the way it is documented the JavaScript is slightly different.

https://help.sap.com/docs/intelligent-robotic-process-automation/cloud-studio-user-guide/call-web-se... 




--------------
See all my blogs and connect with me on Twitter / LinkedIn

Sankara1
Product and Topic Expert
Product and Topic Expert
128

 

Hello Freyagiran,

Thank you for reaching out to us. After reviewing both of your web service calls, I couldn’t find any issues with the configuration or custom code.

The error ENOTFOUND 45.163.29.123 typically indicates that the hostname or IP address in the URL is not reachable or cannot be resolved. Since you are directly using the IP address 45.163.29.123, it seems the application is unable to connect to the specified IP or port.

Possible Reasons and Solutions

  1. Incorrect or Unreachable IP Address

    • Verify that the IP address 45.163.29.123 is correct, reachable, and properly mapped in your network.
    • Port Accessibility

      • Ensure that the specified port 50000 is open and not blocked by a firewall.
      • Connectivity Issues

        • Test the connectivity from the machine where the call is being made. You can run the following command to confirm:
          bash
           
          curl -I https://45.163.29.123:50000

          Refined Payload Example

          If everything checks out, you can use the following payload as an example:

           

          javascript

          let input = {
          "CompanyDB": "URGO_TEST",
          "Password": "xxxxxxxxx.",
          "UserName": "layer"
          };

          return {
          method: 'POST',
          url: "https://45.163.29.123:50000/b1s/v1/Login",
          responseType: 'json',
          resolveBodyOnly: true,
          json: input,
          headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json'
          },
          https: { rejectUnauthorized: false }
          };

          Please let me know if you require further assistance or have additional details to share.

0 Kudos
111

Thanks for your help!!!

I honestly don't know what I did to make it work.

Change the agent version, and also the SDK. I´m currently using agent version 3.24.54, SDK 1.27.60 and it works

I try it with the new versions and it doesn't work

Prasun_Das
Product and Topic Expert
Product and Topic Expert
0 Kudos
78

Hello All,

I am also getting the same issue while making an API call to the S4HANA on-premise system. Basically, my I the automation is trying the generate the CSRF token but it fails with the same issue - queryA ENOTFOUND.

API endpoint - https://sdcnl1dtm002.openstack.eu-nl-1.cloud.sap:44301/sap/opu/odata/sap/API_PURCHASEREQ_PROCESS_SRV

In Postman, it works perfectly fine with the HEAD call and the corresponding csrf token is returned in the response headers. When I implement the same in SBPA with Ajax call (mentioned below), the issue appears:

Please find below the API call defination:

const options = {
    method: 'HEAD',
    useWinCa: true,
    usePassport: true,
    responseType: 'json',
    headers: {
        Authorization: 'Basic ' + irpa_core.base64.encode('demouser' + ':' + 'xxxxxxx'),
        Accept: 'application/json',
        "x-csrf-token":"fetch"
    },
    async: false
};
 
return options;
 
I believe the issue is there with the Desktop Agent.