Skip to content

Spike in Unable to start a transaction in the given time. for new prisma-client #27990

@iamnafets

Description

@iamnafets

Bug description

We're experiencing a spike in errors like this after migrating to the new prisma-client and driverAdapters:

Invalid `prisma.pageView.createMany()` invocation: Transaction API error: Unable to start a transaction in the given time.

It doesn't effect 99% of our requests but crashes those that do get this error. We were not experiencing this error with prisma-client-js.

Severity

🚨 Critical: Data loss, app crash, security issue

Reproduction

Do not have a stable reproduction.

Expected vs. Actual Behavior

No errors.

Frequency

Intermittent / Random

Does this occur in development or production?

Only in development (e.g., CLI tools, migrations, Prisma Studio)

Is this a regression?

Worked in 6.9.0, broken in 6.14.0.

Workaround

No workaround ATM.

Prisma Schema & Queries

model PageView {
  id        String   @id @default(cuid())
  userId    String?
  sessionId String?
  pathName  String
  referrer  String
  timestamp DateTime

  @@index([userId])
  @@index([sessionId])
  @@index([timestamp])
  @@index([pathName])
}
                        pageViews.push({
                            userId: typedPayload.user.userID,
                            sessionId: typedPayload.user.customIDs?.stableID,
                            pathName: typedPayload.metadata.pathname,
                            referrer: typedPayload.metadata.referrer,
                            timestamp: DateTime.fromMillis(typedPayload.timestamp).toJSDate(),
                        });
...

                    await prisma().pageView.createMany({
                        data: pageViews
                    });

Prisma Config

No prisma config.

Logs & Debug Info

// Debug logs here

Environment & Setup

  • OS: Debian
  • Database: Postgres / Aurora Serverless RDS
  • Node.js version: 22.18.0

Prisma Version

6.14.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions