// 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
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
FIX 1Grant table privileges
- 01Open the SQL editor
- 02Run GRANT SELECT, INSERT, UPDATE, DELETE ON public.your_table TO authenticated;
- 03Add anon only if public access is intended
- 04Run NOTIFY pgrst, 'reload schema'; and retry
Did this fix it?FIX 2Pass the user's identity from the server
- 01Create the server client with the request's cookies or the Authorization header
- 02Use the secret/service key only for trusted admin code, never in the browser
Did this fix it?FIX 3Tell grants from RLS
- 01Run the same query as postgres in the SQL editor
- 02If it works there, test with SET ROLE authenticated; to reproduce
- 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 usThe same problem in other apps
Other Supabase errors
- Supabase Project Paused
- Supabase Max Client Connections Reached
- Supabase 'New Row Violates Row-Level Security Policy' Error
- Supabase Confirmation Email Not Sending
- Supabase Auth Redirects to Localhost
- Supabase 'Invalid Refresh Token: Refresh Token Not Found'
- Supabase Edge Function 546 WORKER_LIMIT Error
- Supabase Storage Upload Failed