42501 for edge functions on supabase locally hosted
Errors:
2025-11-14T17:47:01.135190055Z serving the request with supabase/functions/record-eula-acceptance
2025-11-14T17:47:01.262656222Z [Info] Listening on http://localhost:9999/
2025-11-14T17:47:01.262685138Z
2025-11-14T17:47:01.351044222Z [Error] EULA acceptance error: {
2025-11-14T17:47:01.351052347Z code: "42501",
2025-11-14T17:47:01.351053972Z details: null,
2025-11-14T17:47:01.351055180Z hint: null,
2025-11-14T17:47:01.351056305Z message: "permission denied for schema public"
Code fragment:
try {
const supabaseUrl = Deno.env.get("SUPABASE_URL");
const supabaseServiceKey = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY");
if (!supabaseUrl) {
console.error('EULA acceptance error: SUPABASE_URL environment variable not set');
throw new Error("Missing SUPABASE_URL configuration");
}
if (!supabaseServiceKey) {
console.error('EULA acceptance error: SUPABASE_SERVICE_ROLE_KEY environment variable not set');
throw new Error("Missing SUPABASE_SERVICE_ROLE_KEY configuration");
}
const supabaseClient = createClient(
supabaseUrl,
supabaseServiceKey,
{ auth: { persistSession: false } }
);
// Get authenticated user from JWT
const authHeader = req.headers.get("Authorization");
if (!authHeader) {
throw new Error("No authorization header");
}
I am pretty confident that the function has the service_role key !
Any ideas ?
Thanks in advance.
2025-11-14T17:47:01.135190055Z serving the request with supabase/functions/record-eula-acceptance
2025-11-14T17:47:01.262656222Z [Info] Listening on http://localhost:9999/
2025-11-14T17:47:01.262685138Z
2025-11-14T17:47:01.351044222Z [Error] EULA acceptance error: {
2025-11-14T17:47:01.351052347Z code: "42501",
2025-11-14T17:47:01.351053972Z details: null,
2025-11-14T17:47:01.351055180Z hint: null,
2025-11-14T17:47:01.351056305Z message: "permission denied for schema public"
Code fragment:
try {
const supabaseUrl = Deno.env.get("SUPABASE_URL");
const supabaseServiceKey = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY");
if (!supabaseUrl) {
console.error('EULA acceptance error: SUPABASE_URL environment variable not set');
throw new Error("Missing SUPABASE_URL configuration");
}
if (!supabaseServiceKey) {
console.error('EULA acceptance error: SUPABASE_SERVICE_ROLE_KEY environment variable not set');
throw new Error("Missing SUPABASE_SERVICE_ROLE_KEY configuration");
}
const supabaseClient = createClient(
supabaseUrl,
supabaseServiceKey,
{ auth: { persistSession: false } }
);
// Get authenticated user from JWT
const authHeader = req.headers.get("Authorization");
if (!authHeader) {
throw new Error("No authorization header");
}
I am pretty confident that the function has the service_role key !
Any ideas ?
Thanks in advance.