Using Load Balancer's is giving me 404 on a query to table.

I am using https://<project_id>-all.supabase.co url which is of a load balancer to initialize the supabase client. But when I try to query the table, its returning me 404 function not found as error. We have RLS enabled in each and every table.
const { data: currentUser, error } = await supabaseClient
.from("user_profiles")
.select("id, email, username, first_name, last_name, profile_picture_url")
.eq("id", decodedData.sub)
.limit(1)
.single();

if (error) {
console.error("user error", error);
}
const { data: currentUser, error } = await supabaseClient
.from("user_profiles")
.select("id, email, username, first_name, last_name, profile_picture_url")
.eq("id", decodedData.sub)
.limit(1)
.single();

if (error) {
console.error("user error", error);
}
Error: "user error { code: \"NOT_FOUND\", message: \"Requested function was not found\" }\n"
5 Replies
inder
inder•2d ago
I don't see how a url being of a load balancer is relevant here. Are you calling an edge function? This error msg comes up when edge function is not found related: https://github.com/orgs/supabase/discussions/26818
Rohit Shrestha
Rohit ShresthaOP•2d ago
I am trying to setup read replicas with load balancer following: https://supabase.com/docs/guides/platform/read-replicas#deploying-a-read-replica I want to use the endpoint of load balancer to balance the load between read and primary database. What I did was I changed the url of data api to one from load balancer: eg:
const supabaseClient = createClient<Database>(<loadBalancerUrl>, supabaseServiceRoleKey);
const supabaseClient = createClient<Database>(<loadBalancerUrl>, supabaseServiceRoleKey);
After this change, when I try to do the query mentioned above, I get: user error { code: \"NOT_FOUND\", message: \"Requested function was not found\" }\n
Read Replicas | Supabase Docs
Deploy read-only databases across multiple regions, for lower latency.
Rohit Shrestha
Rohit ShresthaOP•2d ago
No description
inder
inder•2d ago
Sorry, I've never used read replicas before so won't be of any help here. You'll have to wait for someone else.
Rohit Shrestha
Rohit ShresthaOP•2d ago
No worries, thank you! 🙇

Did you find this page helpful?