S
Supabase•2mo ago
spy_rex_16

Hello. Getting "Email already exists" internal server error

Hello i manually deleted a user from the authentication table to test out the auth flow from sign up however even though the user with that email doesnt exists in the supabase auth table it still gives me "Email already exists" lol. I know if we make the "@supabase/supabase-js" in package.json 2.49.8, it will fix it however my boss is insistent on having latest version does anyone know a permenant solution for this issue? it will help me al;ot
No description
No description
22 Replies
garyaustin
garyaustin•2mo ago
You should check the logs in the dashboard. If the email is not in the auth table then auth should not error. Has nothing to do with the REST client that I can think of. Are you sure you are not leaving an email in profiles table or similar and checking that on your own? Supabase does not normally generate a signup error for existing email with auth.signup unless you are not confirming email. You have changed the client back and don't get the error? Or you are assuming that it worked and then only getting the error now with a new client.
Once again the REST client does not generate the error, the Auth server on Supabase would.
spy_rex_16
spy_rex_16OP•2mo ago
im 100% sure im getting the information from auth.users when i change @supabase/supabase-js version to 2.49.8 in the package.json everything works but when i update i update @supabase/supabase-js to latest, this issue starts happening
spy_rex_16
spy_rex_16OP•2mo ago
No description
spy_rex_16
spy_rex_16OP•2mo ago
idk why this issue occures ://
garyaustin
garyaustin•2mo ago
Have not seen anyone else report this. I don't see any changes regarding signup in the last releases here: https://github.com/supabase/auth-js/releases And I don't know how a REST client could impact the error. You did not answer if checked the supabase api gateway or auth logs for the call and error there.
spy_rex_16
spy_rex_16OP•2mo ago
i dont see any logs ://
No description
No description
garyaustin
garyaustin•2mo ago
Check the api gateway logs.
spy_rex_16
spy_rex_16OP•2mo ago
nothing
No description
No description
garyaustin
garyaustin•2mo ago
You either are not doing an auth call or you did it more than an hour ago based on your filter. You are not calling that instance if the timeframe of the log is correct.
spy_rex_16
spy_rex_16OP•2mo ago
did these just now in real time
garyaustin
garyaustin•2mo ago
Or you are not generating a REST API call.
spy_rex_16
spy_rex_16OP•2mo ago
really
garyaustin
garyaustin•2mo ago
You mentioned Prisma. Do you somehow check a public table before auth.signUp to see if the user email exists with Prisma?
spy_rex_16
spy_rex_16OP•2mo ago
no the prisma is a fallback
garyaustin
garyaustin•2mo ago
Your logs show you are not calling that instance. Thru the REST API Do you have another instance?
spy_rex_16
spy_rex_16OP•2mo ago
no just one would u look at the function?
garyaustin
garyaustin•2mo ago
Do you anywhere in your code check if a user email exists with a database call? Look at what function?
spy_rex_16
spy_rex_16OP•2mo ago
OKAY NVM U were right i was checking with prisma first
garyaustin
garyaustin•2mo ago
So part of your overall issue is that you should cascade delete or have a delete trigger function on auth.users to clear out your other user table. Probably better with Prisma to do the trigger.
spy_rex_16
spy_rex_16OP•2mo ago
OKAYYYYYY thats a nice idea!
garyaustin
garyaustin•2mo ago
I have no idea how changing the supabase REST version would have impacted this.
spy_rex_16
spy_rex_16OP•2mo ago
thank u for being so patient with me 😭

Did you find this page helpful?