My goal:Run Workflow that uploads data to mySQL server
Issue: Occasionally, the workflow will have errors whilst running a code segment or getting data from SQL, reading "<html> <head><title>502 Bad Gateway</title></head> <body> <center><h1>502 Bad Gateway</h1></center> <hr><center>nginx</center> </body> </html>." Also, specifically in the code segments, occasionally a nonetype error will occur, and this occur because the loop that is getting data will return a similar error as the one listed above, but it lists out more information that I can not see as follows:
Error evaluating get_worksheets_loop (iteration 1): Error fetching data for get_worksheets_loop
response: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
error: Unexpected token '<', "<html>
<h"... is not valid JSON
Steps I've taken to troubleshoot: Looked at the logs and confirmed that they are not from our server that the workflow is touching
Additional info: We are on Retool cloud. The specific data is sensitive, so if it is needed, I am willing to share problematic and the normal cases privately.
This is a a pretty common issue when working with external resources inside Retool Workflows — especially when looping or making repeated SQL/API calls.
What sort of error handling do you have in place?
On the bottom of each block you have some basic settings. This should help.
Hi @Daniel_Fleuranvil, were you able to get things working using @Shawn_Optipath's advice? I think, like he said, that including some retry handling would help here. If you're still having some issues you can send me a workflow ID and a workflow run ID of a failing run and I can take a look.