© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•6mo ago•
11 replies
Meir Tedgi

New User Signup Failing with RLS Error Despite Correct Policy

Hello everyone,
I'm facing a critical issue where new user signups are failing. The user is successfully created in auth.users (I receive the confirmation email), but the trigger to insert a corresponding row into public.user_profiles fails with a 401 Unauthorized error:
new row violates row-level security policy for table "user_profiles"

The problem is that my RLS policy for this action appears to be configured perfectly. I've verified using pg_policies that my single, active INSERT policy is:
* Role: authenticated
* WITH CHECK expression: (auth.uid() = id)
The most critical diagnostic step I've taken is to temporarily disable RLS on the user_profiles table. When I do this, the 401 error disappears, which proves that the RLS system itself is the source of the block, even though the policy seems correct.
I have already fixed other potential issues like NOT NULL constraints and cleaned up orphan rows from previous failed attempts. After re-enabling the correct RLS policy, the 401 error returns.
In summary: a perfectly configured RLS policy is not being respected by the database, and I am completely stuck. Has anyone encountered an issue like this? It feels like a project-specific bug.
Any help or ideas would be greatly appreciated. Thank you!
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

RLS insert still failing for anon role even with correct policy
SupabaseSSupabase / help-and-questions
6mo ago
Error Inviting User After RLS Policy Query
SupabaseSSupabase / help-and-questions
4y ago
RLS Policy Syntax Error
SupabaseSSupabase / help-and-questions
3y ago
TUS error: RLS policy
SupabaseSSupabase / help-and-questions
3y ago