Cloud Storage Permissions Misconfigured in Bolt App
Your Bolt.new application fails to upload, read, or delete files from cloud storage. Users get permission denied errors when trying to upload profile pictures, access shared documents, or view images that should be publicly visible.
Cloud storage services like Supabase Storage and AWS S3 use policy-based access control. If these policies are too restrictive, legitimate operations fail. If they're too permissive, anyone on the internet can read or modify your files. Bolt's AI often generates storage code without configuring the bucket policies correctly.
This typically surfaces right after connecting cloud storage: uploads fail with RLS policy violations, images return 403 errors, or users can see other users' private files because the policies are set to public.
Error Messages You Might See
Common Causes
- Supabase RLS not configured — Storage bucket has Row Level Security enabled but no policies defined, blocking all operations
- Bucket set to private without access policies — The bucket is private (correct) but no policies allow authenticated users to upload or read their files
- Public bucket exposing all files — The bucket is set to public, letting anyone access any uploaded file including private user documents
- Wrong storage bucket name — Code references a bucket name that doesn't exist or is misspelled in the Supabase dashboard
- Service role key used on client — The Supabase service_role key bypasses RLS in development but the anon key used in production respects RLS policies
How to Fix It
- Create proper RLS policies — In Supabase dashboard, add storage policies: allow authenticated users to upload to their own folder (auth.uid()::text = (storage.foldername(name))[1])
- Set bucket visibility correctly — Use private buckets for user files and create signed URLs for access: const { data } = await supabase.storage.from('private').createSignedUrl(path, 3600)
- Use folder-based isolation — Store files in user-specific folders: uploads/{userId}/filename.jpg and restrict access by folder ownership
- Test with anon key — Always test storage operations with the anon key, not service_role, to catch RLS issues before production
- Add public bucket for assets — Create a separate public bucket for truly public assets like product images, and keep user uploads in private buckets
Real developers can help you.
You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.
Get HelpFrequently Asked Questions
Should my Supabase Storage bucket be public or private?
Use private buckets for user-uploaded content (profile photos, documents). Use public buckets only for assets that genuinely need to be accessible to anyone (product images, marketing assets). Always configure RLS policies regardless of visibility.
Why does storage work in development but not production?
In development, you might be using the service_role key which bypasses all RLS policies. In production, the anon key is used and respects RLS. Create proper storage policies that allow authenticated users to manage their own files.