© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
Leo

Can't upload to storage anymore

I've had a public 'avatars' bucket for months now, but all of a sudden I'm getting:

error: {
    statusCode: '401',
    error: 'Invalid JWT',
    message: 'new row violates row-level security policy for table "objects"'
  }
error: {
    statusCode: '401',
    error: 'Invalid JWT',
    message: 'new row violates row-level security policy for table "objects"'
  }


when trying to upload files.

I've added RLS:

bucket_id = 'avatars' AND storage."extension"(name) = 'jpg' AND storage."extension"(name) = 'png' AND LOWER((storage.foldername(name))[1]) = 'public' AND auth.role() = 'anon'
bucket_id = 'avatars' AND storage."extension"(name) = 'jpg' AND storage."extension"(name) = 'png' AND LOWER((storage.foldername(name))[1]) = 'public' AND auth.role() = 'anon'


But upload is still failing with:

  const {error, data} = await supabase.storage.from("avatars").upload(`twitter-990977436916551680.jpg`, buffer, {
    upsert: true,
  });
  const {error, data} = await supabase.storage.from("avatars").upload(`twitter-990977436916551680.jpg`, buffer, {
    upsert: true,
  });


did something change? How can I allow my API to upload files to storage again?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Storage - dashboard upload
SupabaseSSupabase / help-and-questions
4mo ago
Storage upload issue
SupabaseSSupabase / help-and-questions
4y ago
Storage Upload Policies
SupabaseSSupabase / help-and-questions
4y ago
failing upload to storage ssr
SupabaseSSupabase / help-and-questions
3y ago