// troubleshooting guide · supabase

Supabase 'Permission Denied for Table' Error (42501)

Status
Workaround available
platforms:
All clients
updated:
November 22, 2026
reports:
4
Method
how we research
Share

RUNBOOK · supabase/permission-denied-for-table3 FIXES

// quick answer

Error 42501 is usually missing GRANTs for the anon/authenticated role, or a server call without the user's token so auth.uid() is null. Add grants and pass the user's JWT.

Most likely fix: Grant table privileges

How to fix it

// try these in order, the most common fix is first

  1. FIX 1Grant table privileges

    1. 01Open the SQL editor
    2. 02Run GRANT SELECT, INSERT, UPDATE, DELETE ON public.your_table TO authenticated;
    3. 03Add anon only if public access is intended
    4. 04Run NOTIFY pgrst, 'reload schema'; and retry
    Did this fix it?
  2. FIX 2Pass the user's identity from the server

    1. 01Create the server client with the request's cookies or the Authorization header
    2. 02Use the secret/service key only for trusted admin code, never in the browser
    Did this fix it?
  3. FIX 3Tell grants from RLS

    1. 01Run the same query as postgres in the SQL editor
    2. 02If it works there, test with SET ROLE authenticated; to reproduce
    3. 03'permission denied' means grants; 'violates row-level security policy' means policies
    Did this fix it?

SANDBOX · supabase RUNS IN YOUR BROWSER

Try it: edit a table, call it from your app, run SQL

A hands-on Supabase-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.

Symptoms

Queries return 'permission denied for table X' (code 42501), often right after creating a table with SQL or deploying an AI-built app.

Why it happens

  • C-01Table created without GRANT for anon, authenticated or service_role
  • C-02Server-side call made without the user's token (auth.uid() is null)
  • C-03Policies exist but the role has no table privileges
  • C-04Schema cache not refreshed after changes

// this guide also covers

  • supabase permission denied for table
  • supabase 42501
  • supabase permission denied for schema public

Still not working?

If Supabase keeps failing, you're not alone. See every Supabase problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us

Watch Supabase Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Supabase errors

All 16 Supabase errors and fixes →