Supabase · api · fg-0206

Supabase Storage upload fails with 403 new row violates row-level security policy despite an INSERT policy

If you see StorageApiError: new row violates row-level security policy (403), the cause and the fix for Supabase are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
StorageApiError: new row violates row-level security policy (403)INSERT policy on storage.objects matches the bucket and auth.uid()upsert: true uploads fail even when first uploads work
Cause
The Storage API inserts the object row and reads it back in the same statement, so a missing SELECT policy fails the whole upload. Overwrites with upsert also need an UPDATE policy.
Fix
Add SELECT (and UPDATE if you overwrite) policies on storage.objects that mirror the INSERT policy's bucket and path checks.
Apply
create policy "read own files" on storage.objects for select to authenticated using (bucket_id = 'avatars' and (storage.foldername(name))[1] = (select auth.uid())::text); create policy "update own files" on storage.objects for update to authenticated using (bucket_id = 'avatars' and (storage.foldername(name))[1] = (select auth.uid())::text);
Affected
Supabase Storage on all plans with RLS on storage.objects
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun