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?
Hi Ide,
can you please check the service center logs for more details.
The HTTP 502 - bad gateway error occurs when either:
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.
Where in the flow can i pass the current row number?
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
Have you debug the code. where it is failed.
Or possible to provide oml.
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!
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 written2. 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,