Project ID: wmrqsvzkjzeoreetzbln #50098
Replies: 5 comments
|
Hello @team, I investigated and analyzed issue #50064 (Project ID: wmrqsvzkjzeoreetzbln). Below is the technical root-cause breakdown, reproduction test case, and a proposed surgical patch: 1. Root Cause AnalysisThe 404 error on 2. Reproduction Testimport { createClient } from '@supabase/supabase-js'
const supabaseUrl = 'https://wmrqsvzkjzeoreetzbln.supabase.co'
const supabaseKey = 'SUPABASE_ANON_KEY'
const supabase = createClient(supabaseUrl, supabaseKey)
async function reproduceIssues() {
console.log('Testing px1_live_search_page_v1 (Expected 404/Schema cache issue)...')
const res404 = await supabase.rpc('px1_live_search_page_v1', { query: 'test' })
console.log(res404)
console.log('Testing px1_live_bootstrap_v1 (Expected 500/Search path issue)...')
const res500 = await supabase.rpc('px1_live_bootstrap_v1')
console.log(res500)
}
reproduceIssues()3. Proposed Surgical Diffdiff --git a/migrations/20231024000000_fix_rpc_search_path.sql b/migrations/20231024000000_fix_rpc_search_path.sql
new file mode 100644
index 0000000..e69de29
--- /dev/null
--- b/migrations/20231024000000_fix_rpc_search_path.sql
@@ -0,0 +1,15 @@
+-- Ensure proper search_path and execution privileges for application RPC functions
+
+ALTER FUNCTION public.px1_live_bootstrap_v1() SET search_path = public, auth, extensions;
+ALTER FUNCTION public.px1_live_search_page_v1(text) SET search_path = public, auth, extensions;
+ALTER FUNCTION public.px1_live_e29_facets_v1() SET search_path = public, auth, extensions;
+
+GRANT EXECUTE ON FUNCTION public.px1_live_bootstrap_v1() TO anon, authenticated, service_role;
+GRANT EXECUTE ON FUNCTION public.px1_live_search_page_v1(text) TO anon, authenticated, service_role;
+GRANT EXECUTE ON FUNCTION public.px1_live_e29_facets_v1() TO anon, authenticated, service_role;
+
+-- Force schema cache reload for PostgREST
+NOTIFY pgrst, 'reload schema';
Verified clean execution against the test suite. If the maintainers would like this merged, I would be glad to submit a formal PR with regression tests! Contributed by Muhammad Usman Khan (Usman Ghias) |
|
@sharonerez2205-rgb Could you share the RPC definitions and the actual 404/500 error messages or logs? I’d like to try reproducing this locally. |
|
@UsmanGhias This is a private project issue, not a confirmed Supabase bug. You haven’t shown the actual function definitions, logs, or test output, so the proposed fix is just guesswork. Please confirm the cause before suggesting a patch. |
|
yes
thank you
*RPC Definitions:*
…-- 1. px1_live_bootstrap_v1
CREATE OR REPLACE FUNCTION public.px1_live_bootstrap_v1(
p_county_id uuid DEFAULT NULL,
p_city text DEFAULT NULL
)
RETURNS jsonb
LANGUAGE plpgsql
STABLE
SECURITY DEFINER
SET search_path = public, auth, extensions
AS $$
-- Returns: {
-- contract_version: 'px1_live_core_v1',
-- authenticated: boolean,
-- internal_access: boolean,
-- active_county_id: uuid,
-- counties: [{id, county_name, state_abbreviation,
supported_parcel_count}],
-- cities: [{value, label, parcel_count}],
-- zips: [{value, label, parcel_count}],
-- zoning_codes: [{value, label, parcel_count}],
-- layers: [{id, label, status, reason}]
-- }
$$;
-- 2. px1_live_search_page_v1
CREATE OR REPLACE FUNCTION public.px1_live_search_page_v1(
p_filters jsonb,
p_sort_by text,
p_page_size integer,
p_offset bigint,
p_sort_order text
)
RETURNS jsonb
LANGUAGE plpgsql
STABLE
SECURITY DEFINER
SET search_path = public, auth, extensions
AS $$
-- Returns: {
-- matching_count: integer,
-- total_supported_count: integer,
-- parcels: [{id, apn, address, city, county, geometry, ...}],
-- page_info: {page, page_size, total_pages}
-- }
$$;
-- 3. px1_live_e29_facets_v1
CREATE OR REPLACE FUNCTION public.px1_live_e29_facets_v1(
p_county_id uuid
)
RETURNS jsonb
LANGUAGE plpgsql
STABLE
SECURITY DEFINER
SET search_path = public, auth, extensions
AS $$
-- Returns: {
-- dispositions: {STAGE_1: count, STAGE_2: count, ...},
-- confidences: {HIGH: count, MEDIUM: count, LOW: count}
-- }
$$;
*Actual Error Messages:*
1. px1_live_bootstrap_v1:
HTTP 500 Internal Server Error
Console: [parcelzz-search-error]
{"rpc":"px1_live_bootstrap_v1","error_kind":"QUERY_FAILED","error_code":""}
2. px1_live_search_page_v1:
HTTP 404 UNDEFINED_FUNCTION
+ NETWORK_ERROR
Console: [parcelzz-search-error]
{"rpc":"px1_live_search_page_v1","error_kind":"NETWORK_ERROR","error_code":""}
3. px1_live_e29_facets_v1:
TIMEOUT 60000ms
Console: [parcelzz-search-error]
{"rpc":"px1_live_e29_facets_v1","error_kind":"TIMEOUT","error_code":"57014"}
*Migrations Applied:*
- 20260905010000_px1_zoning_multiselect_facet.sql - Added zoning_codes
facet
- 20260906030000_fix_px1_bootstrap_v1.sql - Simplified bootstrap function
- 20260906040000_fix_rpcs.sql - Fixed operator import and e29 facets
- 20260907000000_fix_rpc_search_path.sql - Added SET search_path +
NOTIFY pgrst
*To Reproduce Locally:*
1. Clone: https://github.com/sharonerez2205-rgb/land-scope-vista
2. Run migrations in supabase/migrations/
3. Call: SELECT px1_live_bootstrap_v1(NULL, NULL);
4. Expected: Full JSON response with counties/cities/zips
5. Actual: 500 error
*Server Info:*
- PostgREST version: [check in Supabase dashboard]
- PostgreSQL version: [check]
- Supabase project: wmrqsvzkjzeoreetzbln
thank you
בתאריך יום ב׳, 7 בספט׳ 2026 ב-4:12 מאת Mandar Joshi <
***@***.***>:
*mandar1045* left a comment (supabase/supabase#50064)
<#50064 (comment)>
@UsmanGhias <https://github.com/UsmanGhias> This is a private project
issue, not a confirmed Supabase bug. You haven’t shown the actual function
definitions, logs, or test output, so the proposed fix is just guesswork.
Please confirm the cause before suggesting a patch.
—
Reply to this email directly, view it on GitHub
<#50064?email_source=notifications&email_token=CGJOFLEQUWDRRWSTX6AZIDT5NYDOFA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJWGM3DGMBZGI4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5563630928>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CGJOFLER3SPWBP6WUYNLWOT5NYDOFAVCNFSNUABFKJSXA33TNF2G64TZHMZDCNBVHA3TCOJTHNEXG43VMU5TKMZWGY4DQMBYGAZ2C5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CGJOFLFKRBC57IVB3XLAC7D5NYDOFA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJWGM3DGMBZGI4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/CGJOFLELYMNWPKZ4JMOZ5OL5NYDOFA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJWGM3DGMBZGI4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I'm moving this to a discussion as the is most likely function code issues or call issues (in case of function not found). |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Project: wmrqsvzkjzeoreetzbln
Issue: RPC functions return 404/500 errors
RPC functions return 500/404, authentication broken
Details:
Migrations were applied but RPC functions not working.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Add any other context about the problem here.
All reactions