35
Views
9
Comments
Regarding API
Discussion

Hi all,

I am working on APIs. Its throwing an error like Request failed with status 504 .But backend it is throwing an error but again it is updating and also working fine .After saving ,the data is not visible. Its showing like loading only. May I know how to overcome this issue .Below I attached the screenshots.

Best Regards,

Bhuvaneshwari

2024-12-02 13-16-47
Vipin Yadav

Hi Bhuvaneshwari Reddy,

Implement error handling for the API calls using the built-in Exception Handling mechanisms in OutSystems. 


UserImage.jpg
Buddula Bhuvaneshwari

Hi @Vipin Yadav ,

APIs output are working fine and also we are processing in the flow. But only issue is once the above error comes the continuing client action is not working .

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Bhuvaneshwari,

504 is a gateway timeout. That means that somewhere in the network between the OutSystems server and the REST API provider, something went wrong. This has probably nothing to do with OutSystems.

UserImage.jpg
Bhuvaneshwari Buddula

HI @Kilian Hekhuis ,

If there are errors, then how API is sending the output.


Best Regards

Bhuvaneshwari


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP


Hi Bhuvaneshwari,

I don't quite understand what you mean. When calling a REST API, the OutSystems server contacts the remote server, and the remote server then sends its reponse back (synchronously). Once the server has received the response, it will try to parse it (typically JSON) and map it to the output structure defined in Service Studio. Then the data is ready for the program to use.

A 504 error can only happen when contacting the remote server, or when waiting for the response. In neither case the remote server can send something back which is received. (Other errors can occur when e.g. the JSON is different from what is expected, but not a 504.)

2024-02-02 10-09-47
Mukesh Kumar Deva

Hi @Kilian Hekhuis,

Since I work with that application as well, I'm also not sure what the problem is. Allow me to elaborate on the situation.

We are currently replicating the exact application that is running in a different environment that is already using these APIs and that is functioning flawlessly. The only time we encounter a 504 error is when we attempt to call that API from the application in this environment, even though the output we receive is identical to that of the original application.

Could you please point us in the right direction for resolving this? Please let us know if there are any other details we need you to help.

Thanks & Regards 

Mukesh Kumar Deva

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Mukesh,

At what point do you get the 504 error? You say you are receiving data, but in OutSystems, you cannot receive data (in the application) when you have an error.

Also, if you increase the logging level of the REST API in Service Center, what do you see in the Integration Logging? Do you see the returned JSON, or do you see an error?

2024-02-02 10-09-47
Mukesh Kumar Deva

Hi @Kilian Hekhuis 

We have a server action which calls multiple APIs whose input parameter values (Request) are based on the output values (Response) of the previous APIs. The above error is thrown when the 1st API is triggered but even though the response is received and the remaining action works fine and the remaining APIs also getting triggered based on the response of the 1st API.

I have tried to increase the logging to full and check and got the below stack for it

So we are successfully got the response from the API. So we don't understand the issue here.

Thanks & Regards

Mukesh Kumar Deva

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Well yes, this API is doing fine. But without seeing the code, and knowing per API call what the reply is, it is difficult to know what is causing this.

I can only advise you to debug, go step by step through the code, check the output of each step, check the logging, so you can determine where this problem is caused.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.