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

Transaction already closed when creating project #357

Open
DorianCoding opened this issue Dec 7, 2024 · 5 comments
Open

Transaction already closed when creating project #357

DorianCoding opened this issue Dec 7, 2024 · 5 comments

Comments

@DorianCoding
Copy link

Hello,

I use Stackauth with Supabase and when I want to create a project (from the docker), I got this error:

[API REQ] [nwk50rfd0hrnah2v] POST http://0.0.0.0:8102/api/v1/internal/projects
Captured error in route-handler: PrismaClientKnownRequestError: 
Invalid `prisma.projectUser.findUnique()` invocation:


Transaction API error: Transaction already closed: Could not perform operation.
    at Mn.handleRequestError (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:121:7753)
    at Mn.handleAndLogRequestError (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:121:7061)
    at Mn.request (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:121:6745)
    at async l (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:130:9633)
    at async /app/apps/backend/.next/server/app/api/v1/internal/projects/route.js:623:43
    at async Proxy._transactionWithCallback (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:130:8000)
    at async Object.onCreate (/app/apps/backend/.next/server/app/api/v1/internal/projects/route.js:441:28)
    at async invoke (/app/apps/backend/.next/server/chunks/9252.js:3009:40)
    at async Object.handler (/app/apps/backend/.next/server/chunks/9252.js:3055:36)
    at async invoke (/app/apps/backend/.next/server/chunks/9252.js:3741:24) {
  code: 'P2028',
  clientVersion: '5.20.0',
  meta: {
    modelName: 'ProjectUser',
    error: 'Transaction already closed: Could not perform operation.'
  }
} 

I don't see any logs on Supabase about that. How can I fix this?

@fomalhautb
Copy link
Contributor

Maybe your postgres is too slow so it times out? Can you check if your DB connection works fine?

@DorianCoding
Copy link
Author

Maybe your postgres is too slow so it times out? Can you check if your DB connection works fine?

It is Firebase database so I don’t have mich control.

Can I increase the timeout? However I have no timeout log on Firebase.

@DorianCoding
Copy link
Author

Maybe your postgres is too slow so it times out? Can you check if your DB connection works fine?

It is Firebase database so I don’t have mich control.

Can I increase the timeout?

@fomalhautb
Copy link
Contributor

We have never run it with Firebase, can you try to run a local Postgres docker and see if that works?

@DorianCoding
Copy link
Author

I could try but it would be better to use a cloud database and to be able to increase the timeout or understand why the connection is closing without any logs.

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