random network request fails #33181
Replies: 11 comments
-
Beta Was this translation helpful? Give feedback.
-
That's for the added info here. |
Beta Was this translation helpful? Give feedback.
-
hello, we found that the network timeouts on supabase calls are due to client side not server side (so far as we can tell). what was happening is that our application was making too many supabase calls within a short time. and the client device can only process 12 or 16 or something along those lines at one time even if you have a fast network conn. so the remainder get queued up. eventually the later queued ones hit the 60 second or so default timeout. we were able to track this by intercepting the supabase fetch calls (this is in javascript api of supabase). code snippet below. look for function ourFetch below. partial solution is to batch calls (e.g. instead of trying to pull 1 row at a time from a table, pull a whole bunch of rows at once). other issues we see are repeated calls to the same supabase endpoint due to "reactive" type code. reactive = too many renders, too many data queries. :) that is a client side code problem we have to fix.
|
Beta Was this translation helpful? Give feedback.
-
I'm also experiencing this - even when running Supabase locally. In my case it's definitely related to heavy loads/ lots of requests hitting Supabase at the same time. I have a migration script that pushes a lot of data to Supabase in a short amount of time, throughout hundreds/ thousands of requests. I'll try to batch the calls now. |
Beta Was this translation helpful? Give feedback.
-
Also found this post: https://www.reddit.com/r/Supabase/comments/1g2okq4/intermittent_error_typeerror_fetch_failed/ |
Beta Was this translation helpful? Give feedback.
-
batching definitely fixed it for us. can't spam the Supabase API with lots of tiny calls.... |
Beta Was this translation helpful? Give feedback.
-
I have this same issue, I've profiled my app to ensure minimal requests are made/no rerender spam to the servers yet I still get these. It's quite hard to repro which makes it all the more frustrating. |
Beta Was this translation helpful? Give feedback.
-
I am having the same issue. I'll have several identical calls that take < 100ms, but some randomly take 20 seconds or time out completely! Hard for me to believe I'm one of the very few people seeing this. I see there are current capacity issues on the Supabase status page, but my region, us-east-1 is not mentioned at all. |
Beta Was this translation helpful? Give feedback.
-
![]() I talked to Supabase support and this is their recommendation. Links from email:
Also you can monitor your DB by setting up Supabase Grafana locally |
Beta Was this translation helpful? Give feedback.
-
Thanks, Govind! Will keep this in mind if we run into it again. Ours still seemed to be too many calls stacked up before they had a chance to resolve. Then they timeout'd on the client side before they resolved. Because you only get "low N" network connections simultaneously on a phone. 8, 10, 12, I forget. It's not hundreds :) |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, due to inactivity on this issue I've moved the issue over to discussions/enhancements. |
Beta Was this translation helpful? Give feedback.
-
Bug report
Describe the bug
A clear and concise description of what the bug is.
Random fails from react-native Supabase queries of these forms:
"TypeError: Network request failed"
"TypeError: Network request timed out"
(then a stack trace)
To Reproduce
It is random but happening a lot today.
Expected behavior
Supabase calls should succeed.
Screenshots
N/A
System information
iOS expo react-native
Additional context
Sometimes supabase queries work, sometimes the same queries fails.
What is going on?
Beta Was this translation helpful? Give feedback.
All reactions