Prisma causing app crashes
We use prisma 6.13.0 in our node (v22) server and recently have been seeing an issue where some query would fail crashing our server. We suspect it might have something to do with prisma as we see an double free or corruption (out) error right after our server restarts leaving us to think that it's related to some binary and not our node server. Prisma is pretty much the only thing we have there with a binary running.
It seem to have began a bit after we started doing some raw queries with prisma. We also run some background jobs with pgboss that touch some prisma queries as well and we think that could be part of it too.
Do you have any insights on what could be the root cause of the double free or corruption (out) error?
3 Replies
You've gone full bot mode! Let me fetch that AI answer for you ASAP.
Based on the knowledge sources, "double free or corruption (out)" errors and segmentation faults with Prisma are often linked to incompatibilities between Node.js, OpenSSL versions, and the Prisma engine binaries. These issues have historically appeared when:
- Using Node.js versions 17+ (including 18, 20, and likely 22) on systems with OpenSSL 1.1.x, especially when connecting to databases over TLS (common with cloud providers like AWS RDS or GCP Cloud SQL).
- Running Prisma in Docker containers or on ARM architectures (e.g., M1 Macs, ARM64 Linux).
- Mixing different Node.js and system OpenSSL versions, which can cause the Prisma engine to link against incompatible OpenSSL symbols, leading to memory corruption and crashes, including "double free" errors.
- Using raw queries or background jobs (like with pgboss) can increase the likelihood of hitting these issues, especially if they trigger more complex or concurrent query engine operations.
Workarounds and Solutions:
- Downgrade Node.js to v16.x, which is known to be more stable with older OpenSSL versions and Prisma engines.
- If you must use Node.js 18+ or 20+, ensure your system or Docker image uses OpenSSL 3 (e.g., Ubuntu 22.04+), or switch your Prisma client to use the binary engine by adding
engineType = "binary"
in your schema.prisma
:
- If you are on ARM, ensure your binaryTargets
in schema.prisma
match your deployment environment.
- Upgrading Prisma to the latest version sometimes resolves these issues, but not always if the underlying OpenSSL/Node.js mismatch remains.
If the problem persists on Prisma 6.13.0 and Node 22, it may be a new or resurfaced compatibility issue. In that case, try the above workarounds and consider opening a new issue with detailed logs and your environment info, as recent reports suggest these problems can reappear with new Node.js or OS releasesSegfaults with
Node 18/OpenSSL, ARM/engineType issues.
If you need more targeted help, please provide your OS, Docker image, and database details.
š¤ Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.@Nurul (Prisma) just replied to your email!
Hey!
Thanks, I responded to the email. We can continue the conversation here as well if you prefer Discord š