prisma: Query engine library for current platform "rhel-openssl-1.1.x" could not be found.
Bug description
Outline
Our node.js apps encountered the error on this title. Full message is below:
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
About our app
Our app uses prisma client on fetching a record from PostgreSQL(by AWS RDS) 1:1 by HTTP GET request. GET request endpoint is like this:
https://hash.execute-api.ap-northeast-1.amazonaws.com/stage/path?id=<id>
Situation
The error happened when a Client worker executing regularly calls the REST API using prisma client over and over again. We can find that the database load (connections, memory usage, cpu utilizations and so on) is not much hard.
How to reproduce
Sorry but, we can not find the way to reproduce this error(so that we are hard to solve this problem…).
Expected behavior
No response
Prisma information
schema.prisma
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
previewFeatures = ["interactiveTransactions"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model table_name {
...
}
prisma client code
The mapper implements with prisma client is like this:
async select(id: string): Promise<schema[]> {
const prisma = new PrismaClient()
let condition = {
where: {
id: id,
requester_id: requesterId
}
}
const result = await prisma.schema.findMany(condition)
prisma.$disconnect()
return result
}
package.json
},
"dependencies": {
...
"@prisma/client": "^3.6.0",
...
},
"devDependencies": {
...
"prisma": "^3.6.0",
...
},
}
Environment & setup
We are deploying node.js app using prisma on AWS Lambda.
- Lambda: node.js: 14.x
- AWS Lambda
Prisma Version
$ ./node_modules/.bin/prisma -v
prisma : 3.8.0
@prisma/client : 3.8.0
Current platform : darwin
Query Engine (Node-API) : libquery-engine 34df67547cf5598f5a6cd3eb45f14ee70c3fb86f (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine : migration-engine-cli 34df67547cf5598f5a6cd3eb45f14ee70c3fb86f (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core 34df67547cf5598f5a6cd3eb45f14ee70c3fb86f (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt 34df67547cf5598f5a6cd3eb45f14ee70c3fb86f (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : 34df67547cf5598f5a6cd3eb45f14ee70c3fb86f
Studio : 0.452.0
Other
I could find one like this issue: https://github.com/prisma/prisma/issues/13396 .
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 20 (10 by maintainers)
Hopefully this helps someone. I had the same problem. in our case we had a recursive AWS serverless lambda function that processed a 1mb file from S3 and imported its data into mysql. the function would import only one file and then invoke another instance of itself to process the next file. We have our reasons for this type of process. The error we got was:
The lambda had 128 mb of memory and got this error after processing 3 files.
we increased the memory to 512mb and we got this error after processing 60 files.
We increased the memory to 2048mb and processed 1200 files (loops) (calling await prisma.service.findFirst 1200 times) and all 1200 processed with no error.
So my conclusion is this error is related to memory or lack of…
I will recommend following this guide: https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-aws-lambda
That would indicate that there are some Lambdas where the file can be found, and some where it can not be - as some function executions succeed, and some don’t. As you essentially deploy exactly the same code to all of them, that does not really make a lot of sense 🤔
Looks like you are using the serverless framework. Make sure you are also using the latest version of their tooling.