Expand my Community achievements bar.

POST request with node fetch at action level to Elastic Search API running on port 36029 responses error 503 timeout

Avatar

Level 2

Actually it happens with any method type (post/put/get/delete) request with node fetch at action level to Elastic Search API running on port 36029 responses error 503 timeout, i have events that triggers actions in this case if send a the same request from postman it works fine but the request done at action level when is triggered it responses error 503 timeout which makes me suspect there is some kind of restriction on request sent from adobe io runtime on api endpoints running on non standard ports such like 36029, my question is: can this be possible? and if so how can i change this?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

6 Replies

Avatar

Level 2

To my knowledge there are no restrictions on port numbers used.

  1. What is the response time in Postman?
  2. What library are you using for fetch?
  3. Is there any IP whitelisting on Elastic Search API? Postman might use your VPN but runtime does not.

Regards,

Avatar

Level 2

1- thanks for reply, as i already mentioned while from runtime the response is 503 timeout, in postman works ok which means the response is 200 ok  .

2- fetch js 

3-By the moments theres no whitelisting on ES API is open and theres no VPN.

 

 

Avatar

Level 2

Hi Jose,

 

I understand that the response is 200, what are the response times? How long does it take for the API to respond in Postman. A 503 response usually means that the service is unavailable. That's why I was thinking of IP block.

 

Are you using either fetch or node-fetch?

 

Do you mean by open that it does not have authentication?

 

Regards,

 

Avatar

Level 2

hello thanks again

the api responds in less than 1000ms in postman with 200 ok response, and yes on runtime it says "503 timeout"

i'm using node fetch node-fetch 

authentication is bearer token (by open i mean there's no api whitelisting yet)

Avatar

Level 2

I take it that you request the Bearer token with the same domain but different path/endpoint?

How are you passing the parameters for the search API? Double check that headers and body are passed in the same way. I suggest also trying library make-fetch-happen in my experience this library has more options.

 

Avatar

Level 2

Hello i've finally found that the problem is due to ports not opened for my Elastic Search instance connection so i finally found the problem and the way i'm going to solve it is to change to port used for Elastic Search connection to another port that are already open in App Builder:

Here the doc about the allowed ports:

https://developer.adobe.com/runtime/docs/support/faq/