924
Views
8
Comments
Request failed with status 502 when using "update" server action
Question
Application Type
Reactive

Hey guys. I have an app that allows users to upload documents then the admin can approve or reject the documents uploaded..... The status of the documents is thus updated... I have an on change for the dropdown that updates the document status when the dropdown is clicked.... I wanted to not create duplicates but I get this error whenever I use it but when I use the CreateorUpdate action it works but it creates a duplicate document (which is what we do not want). Any ideas on how I can fix this?


2024-03-22 09-17-23
Chandra Vikas Sharma

Hi Ide,

can you please check the service center logs for more details. 

The HTTP 502 - bad gateway error occurs when either:

  • The timeout of the proxy was reached prior to the request completion.
  • If the connection proxy > server drops.
  • When the response from the server is invalid.
UserImage.jpg
Ide Fatsha

2026-02-26 06-29-24
Rahul
 
MVP

Pass the currentRowNumber ID to status on change action and pass it to your action that time will not create a record it will be update.

UserImage.jpg
Ide Fatsha

Where in the flow can i pass the current row number?

UserImage.jpg
Ide Fatsha

I changed the input parameter on the update server action action to be the current ID of the current row but I still have the same issue.... Its still giving me the "Request failed with action 502" error

2026-02-26 06-29-24
Rahul
 
MVP

Have you debug the code. where it is failed.

Or possible to provide oml.

2020-02-28 09-46-54
Eduardo Jauch

Hello Ide,

May I ask if you are not creating an infinite looping through recursion?

Check if Empormem_Document_Update logic flow has a call to itself or is calling another server action that is calling itself.

Most of the time, 500 errors are related to timeouts due infinite loopings (most of the time related to action recursion (the action calling itself).

Cheers! 

2023-02-25 23-53-32
Sérgio Manuel Silva

Hello Ide, 

Eduardo response make totally sense, infinite loops through recursion will cause stack overflow exceptions and end up crashing the w3wp process running on the server which in turns causes the 502 errors.

If you weren't able to visually identify the recursion, some troubleshooting steps could be

1. Arrange a way to consistently replicate the issue ( ex: only happens on a given user, screen, data inputs, etc)
2. Place some logging at the very end of action Empormem_Document_Update and check if that log is written
2. Iteratively remove parts of the code until the issue does not occur ( hopefully this will allow you to pinpoint which part of the cause is causing it ) 


If even with the above steps you are unable to identify the problem, it is best to open a support case.

Cheers, 

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