Error when using Redis queries

Hi there! I have created a few Redis queries and tried to run them. The behavior is a bit inconsistent:

  • In about half of the cases, queries run successfully as expected
  • In the rest of the cases, they fail with an error: sometimes it says Unknown error and there is a request with 502 Bad Gateway status in DevTools, sometimes the message is request to http://172.20.20.99:80/api/runQuery failed, reason: socket hang up

I have a MongoDB server set up on the same machine and connected to Retool. Queries from it always succeed - so it's not a connectivity issue. Is there anything I can do from my side to fix this error?

3 Likes

Any luck with this? Having the same problem running redis queries against the ssh connection to a bastion aws box.

Hi Alex,

No luck unfortunately. We've tried to keep in touch with Retool support on this issue – but all we've received in the last few weeks is:

Hey there - I have added this to the bug backlog, but I am not sure when it will get picked up as our engineering team is quite backed up right now. I have a note to notify you when this issue is resolved.

Ok cool, really appreciate the update. I can use the local instance for now anyhow to get my page constructed which is convenient.

Cheers,
Alex

Hey @olexlyap, @alex_at_yonder, @zigguratintl,

Apologies on how long this issue has been outstanding. It’s been difficult to track down and prioritize but it is definitely on our end.

It is now one of our top priorities to solve this issue. The work is in progress and it will be at least one engineer’s main focus till it’s fixed. I don’t want to over promise, but at the moment I expect this to be fixed within 1-2 weeks.

3 Likes

Hi @alex-w Any updates with this?

1 Like

@olexlyap, @alex_at_yonder, @zigguratintl

We have improved the redis query performance considerably (I’m no longer able to repro the timeouts running a loop of the same query 1000 times) but I’m not quite ready to declare this all-clear.

How do these timeouts frequencies look on your ends now?

@alex-w, preliminary tests on my side look good as well!

Hello @alex-w! I tested queries earlier today and they worked properly, but now I’m experiencing the same timeout error every time I run queries.

Hey @olexlyap! I just encountered the same thing on one of my test instances, but not on the other :thinking:. Re-saving the resource in the one that was timing out seemed to fix it for me- can you try making an inconsequential change (adding and immediately removing a space to the title for example to enable the Save Changes button) then saving the resource?

@alex-w Renaming the resource did it for me! I will do a few more test runs tomorrow and let you know if there are any issues. Thanks for the assistance!

1 Like

Hi @alex-w! I have done some more testing today. Sometimes my queries started failing again, and I had to rename the resource again to fix it. Currently I can’t provide any details on how to consistently reproduce this. It seems to me that I have to rename it every time I start a session (load the page), although this behavior is not consistent

Hi @alex-w Any further updates with this?

Has the resource disconnected more times for you like above, needing it to be resaved? I experienced the same thing once but haven’t had it come up again, and am looking into how we can cause the behavior

Hey @alex-w!
Yes, the resource had to be resaved before running the queries, and it wasn’t a one-off case, I had to resave it every time I entered the page (but as I mentioned, sometimes the queries ran successfully without resaving).
Currently, though, I’m unable to reproduce this issue. I will provide the details to you if I ever encounter it again

@alex-w The bug has appeared again last Saturday (Oct 24 2020) - and I had to resave again to make it work

Hey @olexlyap, @alex_at_yonder, @zigguratintl!

I have some good news before the weekend — this should be fixed now :grin:

It looks like after a connection in the pool stays alive for quite some time (~10 min), Azure VM closes the connection, but the closed connection isn't removed from the "pool". To avoid this issue, we're getting a new connection from Redis for every query to improve stability!

Thank you all for your patience, and let us know if you're all still seeing any issues here.

3 Likes

Hi Victoria

I know this issue has been fixed for Redis connection.

But we have seen similar issue for MSSQL.

Our application inserts a few hundreds record to our DB, not bucket insert. Most of the cases were success. But a few of them got 502 Bad Gate way error. Could we know if this new connection for every query fix also apply to MSSQL? Any suggestion of avoiding this issue?

Cheers
Mingyu

Hi @Mingyu717! Hmm, this might be a slightly different issue. Would you mind creating a new post or writing into us at support@retool.com or starting a chat from within an app (question mark in the bottom right of an app > Chat with support)?

Curious to learn more about your issue! (We'd want to know things like: did this ever work, if so, when did this start breaking, does this happen for everyone, are the cases that fail the same every time or do they randomly fail, etc.)

Talk to you soon :blush: