Supabase Storage upload fails: new row violates row-level security policy
Image/file upload to Supabase Storage fails with an RLS error? Add policies on storage.objects for INSERT (plus SELECT/UPDATE for upsert).
Reviewed October 14, 2026
What it means in plain English
Supabase Storage keeps file records in a table called storage.objects, protected by its own security rules. Without a rule allowing uploads, every upload is refused.
Likely causes
- No INSERT policy on
storage.objectsfor your bucket. - Using
upsert: truewithout SELECT and UPDATE policies too. - User not signed in.
How to fix it, step by step
- Supabase → Storage → Policies → your bucket → New policy.
- Allow signed-in users to upload, e.g. only into their own folder:
create policy "Users upload to own folder"
on storage.objects for insert to authenticated
with check ( bucket_id = 'avatars' and (storage.foldername(name))[1] = (select auth.jwt()->>'sub') );
- If you overwrite files (upsert), also add SELECT and UPDATE policies.
- For public images, mark the bucket public or add a SELECT policy.
How to check it worked
- Upload a file from the live site; it appears in the bucket.
- Signed-out upload is refused.
Sources
Related fixes
Can't fix it? Get help.
If the steps didn't clear the error, send what the screen says. A person can take a look. This is a request for a paid fix, not an instant chat.