Subject: Auth.users Table Corruption - Need Direct Schema Cleanup Project Details Project ID: xbygmnlimtbeihnobkbq Project URL: https://xbygmnlimtbeihnobkbq.supabase.co Problem Description The auth.users table has corrupted records with NULL confirmation_token values. This corruption is causing the Supabase Admin API's listUsers() function to fail consistently with the error:
"Database error finding users" This prevents all user management operations in our application, including:
Listing existing users in the admin panel Inviting new users Bulk user operations Any automated cleanup attempts Root Cause During development, some test user invitations were created that resulted in incomplete auth.users records. These records have NULL values in the confirmation_token column, which appears to break the Admin API's ability to enumerate users.
Attempted Solutions (All Failed) Bulk Delete via Admin API - Fails because listUsers() cannot enumerate users Orphaned Users Cleanup Tool - Same issue, relies on listUsers() Application-level cleanup - Cannot access auth schema directly from application code Valid Users to PRESERVE Our public.profiles table is clean and contains only these 3 valid users that MUST be preserved. Requested Action Please perform direct database cleanup on the auth.users table to: 1. Identify corrupted records 2. Identify orphaned records (in auth.users but not in profiles) 3. Delete orphaned/corrupted records while preserving the 3 valid users listed above 4. Verify cleanup by confirming listUsers() API works again
Post-Cleanup Verification After cleanup, I need to verify:
Admin panel can list users successfully New user invitations work correctly Existing admin users (Vikrant, Arun) can still log in Urgency This is blocking all user management functionality in our ticketing system. We cannot invite new team members or manage existing users until this is resolved.
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.