© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2mo ago•
40 replies
Saim

new row violates row-level security policy while creating signed urls

RLSstorage🟡javascript
i am trying to create signed url from my react/vite app for my files in private bucket. but it gives me this error
{
    "statusCode": "403",
    "error": "Unauthorized",
    "message": "new row violates row-level security policy"
}
{
    "statusCode": "403",
    "error": "Unauthorized",
    "message": "new row violates row-level security policy"
}

here is my react code trying to create signed url
function Test() {
  const generate = async () => {
    const { data, error } = await supabase.storage
      .from('testing')
      .createSignedUrl('user.jpeg', 60)
    console.log('Data:', data)
    console.log('Error:', error)
  }
  return (
    <>
      <Button onClick={generate}>Generate</Button>
    </>
  )
}
function Test() {
  const generate = async () => {
    const { data, error } = await supabase.storage
      .from('testing')
      .createSignedUrl('user.jpeg', 60)
    console.log('Data:', data)
    console.log('Error:', error)
  }
  return (
    <>
      <Button onClick={generate}>Generate</Button>
    </>
  )
}

Now both the bucket "testing" and the file does exist in the right place but it still gives me this error
i have also tried to create policies for insert, select and update like this and it does not even work for public or authenticated here are my policies
CREATE POLICY "Allow public to read testing bucket objects" ON "storage"."objects"
AS PERMISSIVE FOR SELECT
TO public
USING (bucket_id = 'testing')

CREATE POLICY "Allow public to insert testing bucket objects" ON "storage"."objects"
AS PERMISSIVE FOR INSERT
TO public

WITH CHECK (bucket_id = 'testing')

CREATE POLICY "Allow public to update testing bucket objects" ON "storage"."objects"
AS PERMISSIVE FOR UPDATE
TO public
USING (bucket_id = 'testing')
WITH CHECK (bucket_id = 'testing')
CREATE POLICY "Allow public to read testing bucket objects" ON "storage"."objects"
AS PERMISSIVE FOR SELECT
TO public
USING (bucket_id = 'testing')

CREATE POLICY "Allow public to insert testing bucket objects" ON "storage"."objects"
AS PERMISSIVE FOR INSERT
TO public

WITH CHECK (bucket_id = 'testing')

CREATE POLICY "Allow public to update testing bucket objects" ON "storage"."objects"
AS PERMISSIVE FOR UPDATE
TO public
USING (bucket_id = 'testing')
WITH CHECK (bucket_id = 'testing')
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

StorageApiError: new row violates row-level security policy
SupabaseSSupabase / help-and-questions
4mo ago
upsert() new row violates row-level security policy
SupabaseSSupabase / help-and-questions
4y ago
New row violates row-level security policy for table
SupabaseSSupabase / help-and-questions
4y ago
New row violates row-level security policy for table objects
SupabaseSSupabase / help-and-questions
4y ago