Skip to content

Client hangs indefinitely on deeply nested create queries #28164

Open

Description

@dbrxnds

Bug description

PrismaClient seems to get stuck forever when running a large and deeply nested "create" query. When logging queries the last thing you see is:
prisma:query BEGIN

After that, no query will ever resolve and you have to restart the process.

Subsequent queries (like triggered by new requests) will log to the terminal, but still do not resolve.

Severity

🚨 Critical: Data loss, app crash, security issue

Reproduction

I have tried a lot to create a good reproduction, but I am unable to mimic the exact behavior we are seeing in our application. Could be related to our exact database/sever setup, connections, etc. I don't really know.

But I was able to create a reproduction that hangs forever, although it does not seem to block other queries:
https://github.com/dbrxnds/prisma-create-repro

Though, some things to note:

  • I tested with Supabase, where as our database is MySQL 8 AWS Aurora instance. Though I feel it goes wrong before hitting the database at all
  • I can reproduce it both locally and in our production build consistently in our app.

Expected vs. Actual Behavior

Expected: For these queries to work. But if not, have it throw after a certain threshold.

Actual: It gets stuck without ever erroring or showing a cause. Blocking other queries, causing the whole application to hang.

Frequency

Consistently reproducible

Does this occur in development or production?

Both development and production

Is this a regression?

I don't think so.

Workaround

You can refactor the query to multiple create calls, but that requires you to know which query is causing this issue. Which is difficult in a large codebase. And since it hangs you never get any errors or indication on where it may be.

Prisma Schema & Queries

See reproduction

Prisma Config

See reproduction.

I tried it both with the Rust compiler and Rust-free compiler

Logs & Debug Info

Logs from my terminal:

// Bunch of queries to retrieve data. All is well
orderpicker:dev: 1.1111111111111111e+43 << console logged right before the `.create` query
orderpicker:dev: prisma:query BEGIN << Triggered as part of `.create` query
orderpicker:dev:  GET /some/next/path 200 in 314ms << Refresh page
orderpicker:dev: prisma:query SELECT 1
orderpicker:dev: prisma:query SELECT `database_name`.`table_name`.`column_name` ....Queries that never resolve

Environment & Setup

OS: Linux Mint, MacOS, Debian
Database: Aurora RDS MySQL 8 2x.large
Node.js version: v22.11

Prisma Version

prisma                  : 6.16.2
@prisma/client          : 6.16.2
Computed binaryTarget   : debian-openssl-3.0.x
Operating System        : linux
Architecture            : x64
Node.js                 : v22.11.0
TypeScript              : 5.8.2
Query Engine (Node-API) : libquery-engine 1c57fdcd7e44b29b9313256c76699e91c3ac3c43 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
PSL                     : @prisma/prisma-schema-wasm 6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43
Schema Engine           : schema-engine-cli 1c57fdcd7e44b29b9313256c76699e91c3ac3c43 (at node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x)
Default Engines Hash    : 1c57fdcd7e44b29b9313256c76699e91c3ac3c43
Studio                  : 0.511.0

Activity

  1. added
    kind/bug
    on Sep 25, 2025
  2. added
    bug/1-unconfirmed
    topic: nested write (create/update/delete)
    on Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/1-unconfirmedkind/bugtopic: deep nested relationtopic: nested write (create/update/delete)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions