Unable to load Node-API Library (libquery_engine-linux-arm64-openssl-1.1.x.so.node), Library may be corrupt
See original GitHub issueBug description
Trying to deploy my app on AWS after resolving issue mentioned in issue 15574 I faced with error which says library may be corrupted, It seems no other one have faced the issue, since neither on github prisma issues I found one similar nor on other communities.
Here is the error
Error: Unable to load Node-API Library from /app/libquery_engine-linux-arm64-openssl-1.1.x.so.node, Library may be corrupt
my development platform OS is windows, I am using docker for creating the application image (Alpine Linux)
How to reproduce
- Setup nestjs application with prisma
- Setup prisma client provider and output file in schema.prisma file
- Setup database source in schema.prisma file
- Select proper binary target
- Set PRISMA_QUERY_ENGINE_LIBRARY env variable pointing location of library engine
- Set PRISMA_CLI_BINARY_TARGETS
- Generate Prisma client
- Create docker image
- push and deploy docker image to AWS
- And you will get the error
Expected behavior
No response
Prisma information
generator client {
provider = "prisma-client-js"
output = "client"
}
datasource db {
provider = "mysql"
url = env("PRISMA_DB_URL")
}
// ... rest of my models
Environment & setup
Setup Details
- OS: Amazon Linux 2
- Database: Aurora MySQL
- Node.js version: 16.16.0
- CPE OS Name: cpe:2.3⭕amazon:amazon_linux:2
- Kernel: Linux 4.14.281-212.5.02.amzn2.aarch64
- Architecture: arm64
- Openssl: OpenSSL 1.1.1q 5 Jul 2022
# Environment Variables for deployment on AWS
PRISMA_DB_URL=mysql://username:password@host:port/database
ENV PRISMA_QUERY_ENGINE_LIBRARY=/app/prisma/engines/libquery_engine-linux-arm64-openssl-1.1.x.so.node
ENV PRISMA_CLI_BINARY_TARGETS=linux-arm64-openssl-1.1.x
Prisma Version
# On development PC
prisma : 4.3.1
@prisma/client : 4.3.1
Current platform : windows
Query Engine (Node-API) : libquery-engine c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine : migration-engine-cli c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine : introspection-core c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary : prisma-fmt c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Format Wasm : @prisma/prisma-fmt-wasm 4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b
Default Engines Hash : c875e43600dfe042452e0b868f7a48b817b9640b
Studio : 0.473.0
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Issues - GitHub
Get Unable to load Node-API Library when using prisma in docker ... -debian-openssl-1.1.x.so.node, Library may be corrupt at RequestHandler.
Read more >How to Fix "Unable to load Node-API Library" with Cypress on ...
Here's how to fix the "Unable to Load Node-API Library" error that can come up when trying to use Prisma in Cypress tasks...
Read more >node.js - error states Unable to require(node_modules/prisma ...
It seems there is an issue with the version of OpenSSL installed on your machine. You might need to (re)install OpenSSL.
Read more >How to Repair your Corrupt Final Cut Pro X Library ... - YouTube
Your browser can't play this video. Learn more. Switch camera ... How to Repair your Corrupt Final Cut Pro X Library Database FCPX...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got the same error too, but the different my app image is based on debian os (node:16-bullseye-slim) which in running stage is (gcr.io/distroless/nodejs:16). When I started the image it’s got this error message
PrismaClientInitializationError: Unable to load Node-API Library from /node_modules/.prisma/client/libquery_engine-debian-openssl-1.1.x.so.node, Library may be corrupt
I’ve tried to set binaryTargets to “debian-openssl-1.1.x” still not worked.
I am opening new issue