Replies: 4 comments 1 reply
-
|
Hey @ManorovG, just adding a thought here that might help with debugging. It could be two things happening at once: When you call signUp with email confirmation enabled, the user is still treated as anon until they confirm their email. At the same time, Supabase Storage also checks bucket settings (like whether the bucket is public), not only RLS policies. So even if you set up a policy that gives the anon role full permission to add files into the storage objects table, without placing any conditions or restrictions on what they can insert, the upload can still fail if the bucket itself is not configured to allow writes from anonymous users. The request can still fail if the bucket isn’t public or doesn’t allow writes from anon. A couple of quick checks that might help narrow it down:
That should help figure out if this is really RLS being ignored, or if Storage is rejecting anon uploads earlier in the flow. |
Beta Was this translation helpful? Give feedback.
-
|
Also make sure you don't have upsert option set for the upload. If so then you need to meet select policy. |
Beta Was this translation helpful? Give feedback.
-
|
Hi everyone, I'll move this over a discussion as seems more debugging than an issue. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I am having a similar error. Is this resolved yet what was the final solution. Please share. Thank you. INSERT policies exist for anon, authenticated, public (WITH CHECK true), AND supabase_storage_admin (WITH CHECK bucket_id='candidate-cvs'). Upload still fails. A policy explicitly covering supabase_storage_admin still being violated indicates the Storage service's role/RLS handling is malfunctioning for this project. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
Hello,
I am experiencing a persistent "new row violates row-level security policy" error when trying to upload a file to Storage.
Context:
supabase.auth.signUp()call.anonrole.Troubleshooting Done:
PERMISSIVEpolicy for theanonrole toINSERTon my 'documents' bucket.WITH CHECKexpression to simplytrue.WITH CHECK (true)policy.A query on
pg_policiesshows that this is the only policy onstorage.objects, and it is configured correctly. There are also no custom triggers. It seems the RLS policy is not being respected.Could you please investigate why my project might be behaving this way?
My Project Ref is: [qrtywghupjaljhxblpcd]
Beta Was this translation helpful? Give feedback.
All reactions