403 Error on attempt to upload to public bucket. #30228
Replies: 4 comments 1 reply
-
as a note i've tried this on various new buckets. I also have no custom triggers setup that would cause knock on effect. |
Beta Was this translation helpful? Give feedback.
-
It is expected if you don't meet RLS to get that error. Even public buckets need RLS for upload. You have upsert false so do not need to meet select/update policies. Is that your only insert policy. That one does not show a TO clause (like authenticated/anon/public) so would default to public and work with anon or authenticated. So.... are you going to the correct instance? Can you see the request in the Storage or Gateway API logs? |
Beta Was this translation helpful? Give feedback.
-
Hey, Thanks for the response. That is the only RLS policy on that bucket. Where you mention I don't have "to clause"... but there is one.. "on storage.objects for insert to public with check (" Here's the error log from the storage logs in the supabase backend in the expected instance. ` "message" "name" "raw" "stack"
|
Beta Was this translation helpful? Give feedback.
-
It turned out; that there was an error occurring in a public bucket policy that was causing a failure. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, i'm getting a 403 error
{
"statusCode": "403",
"error": "Unauthorized",
"message": "new row violates row-level security policy"
}
From the code... run from a client component on a public facing page on the web with no auth setup
(nextjs 14) "@supabase/supabase-js": "^2.45.4",
This is my policy
Is this the expected behaviour?
Beta Was this translation helpful? Give feedback.
All reactions