Getting an error after SQL DB based flow is run

I am having a work flow which runs a query to insert @3000 records int o a SQL table.

Though it is doing the insertion properly, I am getting an error as shown below fopr the past few days.

Error Message:
Error evaluating sourceDb: Error fetching data for sourceDb
response:

502 Bad Gateway

502 Bad Gateway


nginx

error: Unexpected token < in JSON at position 0
The above error was not there when the flow was initially designed and implemented. Also, though it shows error, the query has run correctly.

2 Likes

Hi @Sivaram! Welcome back to the community and thanks for reaching out. :slightly_smiling_face:

I usually see this kind of error in self-hosted instances, but it looks like you're running a cloud instance. Can you confirm that?

Yes Darren it is running on a cloud instance

Thanks. :+1: This is typically indicative of an infrastructure issue, which means that whatever caused this particular error has most likely been identified and addressed by our team here. To that end, I don't see any similar errors in your backend logs over the past month or so. Has this workflow been running since you originally posted?

Actually we have migrated to a similar new workflow (Table alone gets changed) and even there we are still facing the same issue. Please find snapshot

Thanks for providing that context, @Sivaram. :thinking: I'm able to see the corresponding logs in our backend, which make me think that there might be an issue with the resource or query itself. I'm specifically seeing quite a few errors about violating a specific table's primary key constraint. I'll send you a screenshot with the details via DM.

The other possibility is that the response from your resource isn't being properly forwarded by whatever networking you have in place around it. Do you know if the SQL resource sits behind a reverse proxy or something similar?

Hello Darren
Primary key conflict issue will not occur unless the workflow is run second time in a day. We are eliminating the same by using a Merge in SQL query
The SQL server is sitting on a Azure Cloud Server and it is not behind any proxy

I have made changes to avoid any primary key conflict but still the exception occurs.

The same is running in the server perfectly. Please refer snapshot

Also, some of the other workflows (not all of them) with similar logic run without any errors in the same server.
Is there any issues with Time out due to size which can be set some where. I am seeing a pattern when time consuming queries are run.

That's a good observation. You can try extending the query timeout in the Settings menu to something more than the default 10 seconds, if you haven't already. It still seems odd that this would throw a 502 error, though.

The issue got resolved after increasing the Time out. Thanks.

1 Like