404 Error on Supabase Database Function Call for One Authenticated User, but Not Another

Hello, I'm running into an issue with a Supabase database function in the public schema. User A is able to call the function without any problems, but User B (with a different account and email) receives the following error: POST https://....supabase.co/rest/v1/rpc/[function name] 404 (Not Found) Both users are authenticated and should have EXECUTE permissions on the function. The function is defined with SECURITY DEFINER, and search_path is explicitly set to public. Does anyone know what might be causing this discrepancy between users? Any ideas for further debugging steps would be greatly appreciated. Thanks!
2 Replies
garyaustin
garyaustin3w ago
404 is not found versus permission error. This could also include parameters not matching the function definition. Check the API Gateway logs to see if there is more info there and the function name is correct. Also check the Postgres log to see if any info. Try impersonating the user in the SQL editor and see if you can select the function.
(Adequate)^-1
(Adequate)^-1OP3w ago
Simulating the user helped a lot and I solved the issue. Thank you!

Did you find this page helpful?