Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot login on previously created accounts after migrating installation #1506

Open
pedrofnts opened this issue May 13, 2024 · 1 comment
Open

Comments

@pedrofnts
Copy link

pedrofnts commented May 13, 2024

I've migrated my Typebot installation to a new VPS. Initially, everything was functioning smoothly: all accounts were accessible (since sessions were preserved in the browser), and all bots were operational.

However, an issue arose when I had to log out of my account. Now, I am unable to log back in. Although I receive the email with the magic link, attempting to log in results in the error message "Try signing in with a different account."

Captura de Tela 2024-05-13 às 10 32 33

In the container logs, I noticed that Prisma attempts to create a new account using this email, despite it already existing in the database (since this user was previously registered).

Here are the pertinent log entries:

prisma:info Starting a postgresql pool with 5 connections. prisma:error Invalid prisma.user.create() invocation: Unique constraint failed on the fields: (email) [next-auth][error][adapter_error_createUser] https://next-auth.js.org/errors#adapter_error_createuser Invalid prisma.user.create() invocation: Unique constraint failed on the fields: (email) { message: '\n' + 'Invalid prisma.user.create() invocation:\n' + '\n' + '\n' + 'Unique constraint failed on the fields: (email)', stack: 'PrismaClientKnownRequestError: \n' + 'Invalid prisma.user.create() invocation:\n' + '\n' + '\n' + 'Unique constraint failed on the fields: (email)\n' + ' at In.handleRequestError (/app/node_modules/.pnpm/@prisma+client@5.12.1_prisma@5.12.1/node_modules/@prisma/client/runtime/library.js:122:6854)\n' + ' at In.handleAndLogRequestError (/app/node_modules/.pnpm/@prisma+client@5.12.1_prisma@5.12.1/node_modules/@prisma/client/runtime/library.js:122:6188)\n' + ' at In.request (/app/node_modules/.pnpm/@prisma+client@5.12.1_prisma@5.12.1/node_modules/@prisma/client/runtime/library.js:122:5896)\n' + ' at async l (/app/node_modules/.pnpm/@prisma+client@5.12.1_prisma@5.12.1/node_modules/@prisma/client/runtime/library.js:127:11167)\n' + ' at async createUser (/app/apps/builder/.next/server/chunks/524.js:1:672)', name: 'PrismaClientKnownRequestError' }

New accounts are able to log in without issues; the problem only occurs with accounts that were created prior to the migration.

@baptisteArno
Copy link
Owner

So it seems it tries to create the user even though a user with that email already exists.

I'm a bit clueless 🤔 I don't know why it happens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants