Query Engine Library Not Found
See original GitHub issueBug description
We have recently been seeing query engine library errors on our app hosted on vercel. This has been happening for about a day and suddenly started happening intermittently. This is really weird because it says it wants “rhel-openssl-1.1.x” and that we incorrectly pinned to “rhel-openssl-1.1.x”.
We have tried to explicitely add binaryTargets = ["native", "rhel-openssl-1.0.x", "rhel-openssl-1.1.x"]
, but this causes our build to fail with function size errors.
I would appreciate any pointers here.
Query engine library for current platform "rhel-openssl-1.1.x" could not be found.
You incorrectly pinned it to rhel-openssl-1.1.x
This probably happens, because you built Prisma Client on a different platform.
(Prisma Client looked in "/var/task/node_modules/@prisma/client/ultron/runtime/libquery_engine-rhel-openssl-1.1.x.so.node")
Searched Locations:
/var/task/node_modules/@prisma/.prisma/client
/vercel/path0/node_modules/@prisma/client/ultron
/var/task/node_modules/@prisma/client/ultron
/var/task/node_modules/@prisma/client/ultron
/var/task/node_modules/@prisma/client/ultron
/tmp/prisma-engines
/var/task/node_modules/@prisma/client/ultron
To solve this problem, add the platform "rhel-openssl-1.1.x" to the "binaryTargets" attribute in the "generator" block in the "schema.prisma" file:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native"]
}
Then run "prisma generate" for your changes to take effect.
Read more about deploying Prisma Client: https://pris.ly/d/client-generator
I see a related issue here: #13266
How to reproduce
It currently seems to cause random requests to error out. I am not able to identify a pattern here.
Expected behavior
I expect the right query engine library to be used.
Prisma information
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["filterJson", "dataProxy"]
output = "../../../../node_modules/@prisma/client/ultron"
}
generator dbml {
provider = "prisma-dbml-generator"
}
Environment & setup
This is currently happening on vercel’s serverless platform which I believe uses AWS.
Prisma Version
prisma : 3.11.1
@prisma/client : 3.11.1
Current platform : darwin-arm64
Query Engine (Node-API) : libquery-engine 1a2506facaf1a4727b7c26850735e88ec779dee9 (at node_modules/prisma/node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine : migration-engine-cli 1a2506facaf1a4727b7c26850735e88ec779dee9 (at node_modules/prisma/node_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine : introspection-core 1a2506facaf1a4727b7c26850735e88ec779dee9 (at node_modules/prisma/node_modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary : prisma-fmt 1a2506facaf1a4727b7c26850735e88ec779dee9 (at node_modules/prisma/node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
Default Engines Hash : 1a2506facaf1a4727b7c26850735e88ec779dee9
Studio : 0.458.0
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:15 (5 by maintainers)
Top GitHub Comments
I think the cause of this issue is that Prisma is not searching the correct directory for the binary.
in my case I am compiling for AWS lambda, I get the error:
looking at the search paths it is missing
The binaries are located here and not in the
@prisma/client
directoryI’ve tried @VictorArowo’s approach, but still running into issues. Bizarrely, the error is pretty contradictory:
In my particular implementation, I’m using this in a Yarn workspaces monorepo (test repo) with serverless-webpack-prisma. The same monorepo also reuses this Prisma client from a shared package in a Next.js site workspace, and Prisma works fine there, making me think my problem might actually be more specific to serverless-webpack-prisma (I’ve also asked there in this issue.
More detailed error message: