storage 403 error

I created a custom bucket and defined RLS policies for storage.objects using the Supabase UI.

CREATE POLICY "everything 1ffg0oo_0" ON storage.objects FOR SELECT TO service_role USING (bucket_id = 'images');
CREATE POLICY "everything 1ffg0oo_1" ON storage.objects FOR INSERT TO service_role WITH CHECK (bucket_id = 'images');
CREATE POLICY "everything 1ffg0oo_2" ON storage.objects FOR DELETE TO service_role USING (bucket_id = 'images');
CREATE POLICY "everything 1ffg0oo_3" ON storage.objects FOR UPDATE TO service_role USING (bucket_id = 'images');



Yesterday, everything worked fine — the policies allowed access as expected.

{statusCode: "403", error: "Unauthorized", message: "new row violates row-level security policy"}


However, after running a DB reset and reapplying the exact same policies, they no longer work. I'm getting 403 errors when trying to access the storage, even though nothing has changed in the code or policy definitions.

I'm using Next.js and uploading via the service_role key on the server side. I've double-checked the key and configuration multiple times, so I believe that's not the issue.
2025-06-24_152001.png
Was this page helpful?