Transaction API error: Transaction already closed: Transaction is no longer valid. Last state: 'Expired' P2028
See original GitHub issueBug description
"Transaction API error: Transaction already closed: Transaction is no longer valid. Last state: 'Expired'."
I’m using 3.14.0 I increased timeouts and these queries generally take ~500ms though they can take longer under load
{
maxWait: 20000, // default: 2000
timeout: 60000, // default: 5000
}
{"is_panic":false,"message":"Transaction API error: Transaction already closed: Transaction is no longer valid. Last state: 'Expired'.","meta":{"error":"Transaction already closed: Transaction is no longer valid. Last state: 'Expired'."},"error_code":"P2028","clientVersion":"3.14.0"}
Slack thread: https://prisma.slack.com/archives/CCWDULGUW/p1654457710257189
How to reproduce
Do a bunch of complex interactive transactions in different lambda functions running in parallel
Expected behavior
No response
Prisma information
3.14.0, in a lambda layer serverless stack
Environment & setup
- OS: Lambda
- Database: Postgres
- Node.js version: 14
Prisma Version
prisma : 3.14.0
@prisma/client : 3.14.0
Current platform : darwin
Query Engine (Node-API) : libquery-engine 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine : migration-engine-cli 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : 2b0c12756921c891fec4f68d9444e18c7d5d4a6a
Studio : 0.460.0
Issue Analytics
- State:
- Created a year ago
- Reactions:12
- Comments:42 (11 by maintainers)
Top Results From Across the Web
any suggestions about what to do with this error Transaction
"Transaction API error: Transaction already closed: Transaction is no longer valid. Last state: 'Expired'." I'm using 3.14.0 I increased timeouts and these ...
Read more >How to use $transaction API in this scenario? - prisma
a will never be inserted into the database as the prisma.user.create() command will only be called inside prisma.$transaction so you do not ......
Read more >Transactions and batch queries (Reference) - Prisma
This page explains the transactions API of Prisma Client.
Read more >Prisma 4.7.0 Release - GitClear
Interactive transactions are now Generally Available · Relation mode is Generally Available · Prisma Client Extensions (Preview) · Multi-schema ...
Read more >It's Prisma Time - Transactions - DEV Community
So, can Prisma not handle them? Obviously the answer is no. In this moment, Prisma handles the transactions in two ways, the first...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes this bug keeps troubling and blocks the development. Have tried killing idle processes, disconnecting all open connections, stopping database server but nothing works. Somehow it finds that some transaction was not closed properly.
This issue was closed with https://github.com/prisma/prisma/issues/9584 in version 3.9 I have version 3.14 but the issue still exists.
Any update on this?