Prisma cannot find a query engine for debian-openssl in Docker
Query engine library for current platform "debian-openssl-1.1.x" could not be foundShort answer
Prisma Client ships a query engine built for one OS and OpenSSL version. If it was generated for a different target than the one running, or Prisma cannot detect OpenSSL and falls back to 1.1.x, the engine file is missing. List the right target in binaryTargets, then run prisma generate again inside the image.
Fix it fast
1Find out which cause you have
Read the platform name in the error. It is what Prisma detected inside the container, and it must match a target that was generated.
docker run --rm my-image sh -c "cat /etc/os-release; openssl version"2Match what you see, then jump to its fix
- 1
The build or install ran on macOS, Windows or a different image, then node_modules was copied into the containerClient generated on another OS than the one that runs itFix - 2
The error names openssl-1.1.x on an image that is newer, and the image is a minimal oneOpenSSL is not installed, so Prisma assumes 1.1.xFix
- 1
What does the error look like?
Query engine library for current platform "debian-openssl-1.1.x" could not be found
Cause 1 of 2
Client generated on another OS than the one that runs it
1Check
binaryTargets defaults to native, meaning the OS where prisma generate ran. An engine built for macOS is not the one a Debian container needs.
grep -n -A4 "generator client" prisma/schema.prisma2Fix
Add the target for the OS that runs the app next to native. The Prisma reference lists names such as debian-openssl-3.0.x for Debian 12 and linux-musl-openssl-3.0.x for Alpine 3.17 and newer. Then generate again.
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-3.0.x"]
}
// then: npx prisma generate3Verify
Rebuild the image and start the container.
docker build -t my-image . && docker run --rm my-imageConfirmed by prisma.io
Cause 2 of 2
OpenSSL is not installed, so Prisma assumes 1.1.x
1Check
When Prisma cannot find OpenSSL it defaults to 1.1.x. Prisma supports OpenSSL 1.0.x, 1.1.x and 3.x, and the OpenSSL and glibc or musl versions must match the system requirements table.
docker run --rm my-image sh -c "openssl version"2Fix
Make OpenSSL available in the image, or state the exact target with binaryTargets so Prisma does not guess. Pick the name that matches your base image from the reference table, then regenerate.
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-3.0.x"]
}3Verify
Rebuild the image and start the container.
docker build -t my-image . && docker run --rm my-imageConfirmed by prisma.io
How do I stop it coming back?
- Run prisma generate inside the Docker build, on the same base image that runs the app.
- Keep the base image and the binaryTargets entry in the same pull request when you change either.
- Do not copy node_modules from your laptop into an image.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
Related fixes
Back end
Node.js in Docker Compose cannot reach MySQL on 127.0.0.1:3306
Error: connect ECONNREFUSED 127.0.0.1:3306
Inside a container, 127.0.0.1 is that container, not MySQL.
3 causes, each with a fixBack end
A Docker build or container says npm: not found
npm: command not found
A container only has the programs its image holds.
3 causes, each with a fixBack end
ECS task stops with exec format error on start
exec /usr/local/bin/docker-entrypoint.sh: exec format error
The container's binary was built for another CPU than the task runs on.
2 causes, each with a fixBack end
Kong Gateway returns 502 'An invalid response was received from the upstream server'
upstream sent too big header while reading response header from upstream
Kong returns 502 when it cannot get a valid HTTP response from the upstream.
4 causes, each with a fixBack end
Node.js cannot connect to MongoDB: ECONNREFUSED on port 27017
MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
ECONNREFUSED means nothing accepted the connection at that address and port.
4 causes, each with a fixBack end
NestJS watch mode does not restart after I save a file
Changes show on the host but not in the running container
Watch mode only sees files that exist inside the process that runs it.
3 causes, each with a fix