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

Unable to transact into database #23

Open
mshumayl opened this issue Apr 10, 2023 · 1 comment
Open

Unable to transact into database #23

mshumayl opened this issue Apr 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mshumayl
Copy link
Owner

prisma:error 
Invalid `p.session.findUnique()` invocation in
Z:\Noconda\quran-gpt\quran-gpt\node_modules\@next-auth\prisma-adapter\dist\index.js:24:52

  21     where: { provider_providerAccountId },
  22 }),
  23 async getSessionAndUser(sessionToken) {
→ 24     const userAndSession = await p.session.findUnique(
Server has closed the connection.
[next-auth][error][adapter_error_getSessionAndUser]
https://next-auth.js.org/errors#adapter_error_getsessionanduser
Invalid `p.session.findUnique()` invocation in
Z:\Noconda\quran-gpt\quran-gpt\node_modules\@next-auth\prisma-adapter\dist\index.js:24:52

  21     where: { provider_providerAccountId },
  22 }),
  23 async getSessionAndUser(sessionToken) {
→ 24     const userAndSession = await p.session.findUnique(
Server has closed the connection. {
  message: '\n' +
    'Invalid `p.session.findUnique()` invocation in\n' +
    'Z:\\Noconda\\quran-gpt\\quran-gpt\\node_modules\\@next-auth\\prisma-adapter\\dist\\index.js:24:52\n' +
    '\n' +
    '  21     where: { provider_providerAccountId },\n' +
    '  22 }),\n' +
    '  23 async getSessionAndUser(sessionToken) {\n' +
    '→ 24     const userAndSession = await p.session.findUnique(\n' +
    'Server has closed the connection.',
  stack: 'Error: \n' +
    'Invalid `p.session.findUnique()` invocation in\n' +
    'Z:\\Noconda\\quran-gpt\\quran-gpt\\node_modules\\@next-auth\\prisma-adapter\\dist\\index.js:24:52\n' +
    '\n' +
    '  21     where: { provider_providerAccountId },\n' +
    '  22 }),\n' +
    '  23 async getSessionAndUser(sessionToken) {\n' +
    '→ 24     const userAndSession = await p.session.findUnique(\n' +
    'Server has closed the connection.\n' +
    '    at Zr.handleRequestError (Z:\\Noconda\\quran-gpt\\quran-gpt\\node_modules\\@prisma\\client\\runtime\\library.js:171:6414)\n' +
    '    at Zr.handleAndLogRequestError (Z:\\Noconda\\quran-gpt\\quran-gpt\\node_modules\\@prisma\\client\\runtime\\library.js:171:5948)\n' +
    '    at Zr.request (Z:\\Noconda\\quran-gpt\\quran-gpt\\node_modules\\@prisma\\client\\runtime\\library.js:171:5786)\n' +
    '    at async t._request (Z:\\Noconda\\quran-gpt\\quran-gpt\\node_modules\\@prisma\\client\\runtime\\library.js:174:10455)\n' +
    '    at async getSessionAndUser (Z:\\Noconda\\quran-gpt\\quran-gpt\\node_modules\\@next-auth\\prisma-adapter\\dist\\index.js:24:36)',
  name: 'Error'
}
[next-auth][error][SESSION_ERROR] 
https://next-auth.js.org/errors#session_error
Invalid `p.session.findUnique()` invocation in
Z:\Noconda\quran-gpt\quran-gpt\node_modules\@next-auth\prisma-adapter\dist\index.js:24:52

  21     where: { provider_providerAccountId },
  22 }),
  23 async getSessionAndUser(sessionToken) {
→ 24     const userAndSession = await p.session.findUnique(
Server has closed the connection. Error:
Invalid `p.session.findUnique()` invocation in
Z:\Noconda\quran-gpt\quran-gpt\node_modules\@next-auth\prisma-adapter\dist\index.js:24:52

  21     where: { provider_providerAccountId },
  22 }),
  23 async getSessionAndUser(sessionToken) {
→ 24     const userAndSession = await p.session.findUnique(
Server has closed the connection.
    at Zr.handleRequestError (Z:\Noconda\quran-gpt\quran-gpt\node_modules\@prisma\client\runtime\library.js:171:6414)
    at Zr.handleAndLogRequestError (Z:\Noconda\quran-gpt\quran-gpt\node_modules\@prisma\client\runtime\library.js:171:5948)
    at Zr.request (Z:\Noconda\quran-gpt\quran-gpt\node_modules\@prisma\client\runtime\library.js:171:5786)
    at async t._request (Z:\Noconda\quran-gpt\quran-gpt\node_modules\@prisma\client\runtime\library.js:174:10455)
    at async getSessionAndUser (Z:\Noconda\quran-gpt\quran-gpt\node_modules\@next-auth\prisma-adapter\dist\index.js:24:36) {
  name: 'GetSessionAndUserError',
  code: 'P1017'
}
❌ tRPC failed on db.addNote: UNAUTHORIZED
@mshumayl mshumayl added the bug Something isn't working label Apr 10, 2023
@mshumayl
Copy link
Owner Author

Not sure what fixed it, but I did the following:

  1. Logged into Supabase https://app.supabase.com/project/bgvcawhjgoqgeeuyajeu/ again.
  2. Reload the Supabase editor.
  3. Rerun npx prisma migrate dev

And I am now able to make a new transaction into Supabase.

It seems there was an issue with authentication. Not sure if it's from NextAuth.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant