Edge Function + Google Cloud Integration Issues
Hey everyone 
I’m building a SaaS for PDF document processing — files are uploaded to Supabase Storage, processed via Google Cloud Vision + Vertex AI (GCP), and structured into Supabase tables.
Running locally in Cursor on localhost.
Setup
Function: process-document
Region: europe-west3 (Frankfurt)
Goal: OCR + AI parsing → structured Excel-like data
Fixed Issues
req.json() called twice → fixed
GCP credentials JSON quotes → fixed
supabase secrets set GOOGLE_APPLICATION_CREDENTIALS="$(cat service-account-key.json)"
Storage RLS for service_role → fixed
Current Problem
Function runs but returns:
FunctionsHttpError: Edge Function returned a non-2xx status code
500 Internal Server Error
No detailed logs shown — can’t see root cause.
Questions
How to view detailed Edge Function logs for 500 errors?
Best practice for GCP service account keys inside Edge Functions?
Proper RLS setup for file downloads via service_role?
Handling large PDFs / long OCR+LLM tasks — stay in Edge or use Cloud Run / queues?
Can GCP directly insert processed data into Supabase tables, or must it go via API / Cloud Function?
I’m building a SaaS for PDF document processing — files are uploaded to Supabase Storage, processed via Google Cloud Vision + Vertex AI (GCP), and structured into Supabase tables.
Running locally in Cursor on localhost.
Function: process-document
Region: europe-west3 (Frankfurt)
Goal: OCR + AI parsing → structured Excel-like data
supabase secrets set GOOGLE_APPLICATION_CREDENTIALS="$(cat service-account-key.json)"
Function runs but returns:
FunctionsHttpError: Edge Function returned a non-2xx status code
500 Internal Server Error
No detailed logs shown — can’t see root cause.