Unknown PRISMA_QUERY_ENGINE_LIBARARY linux-arm64-openssl-undefined
See original GitHub issueBug description
I was encountered with unknown query engine library error while I was trying to deploy my service on AWS Here is the error I got
Trying too much finding solution, but it seems Prisma can not detect proper query engine type
Setting binary target to native or arm does not solve the issue
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
Prisma must specify right binary target it needs instead of displaying unknown
Prisma information
generator client {
provider = "prisma-client-js"
output = "client"
engineType = "library"
}
datasource db {
provider = "mysql"
url = env("PRISMA_DB_URL")
}
// ... rest of my models
import { INestApplication, Injectable, OnModuleInit } from '@nestjs/common';
import { PrismaClient } from './client';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
async onModuleInit() {
await this.$connect();
}
async enableShutdownHooks(app: INestApplication) {
this.$on('beforeExit', async () => {
await app.close();
});
}
}
// PrismaService is then used to query database inside the project
Environment & setup
Setup Details
- OS: Amazon Linux 2
- Database: Aurora MySQL
- Node.js version: 16.16.0
- CPE OS Name: cpe:2.3:o:amazon:amazon_linux:2
- Kernel: Linux 4.14.281-212.5.02.amzn2.aarch64
- Architecture: arm64
# Environment Variables
PRISMA_DB_URL=mysql://username:password@host:port/designtool?database
ENV PRISMA_QUERY_ENGINE_LIBRARY=/app/prisma/engines/linux-arm64-openssl-3.0.x
ENV PRISMA_CLI_BINARY_TARGETS=linux-arm64-openssl-3.0.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:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Provide precompiled binaries for ARM #861 - prisma ... - GitHub
Results in an error ! Unknown binaryTarget linux-arm64-openssl-undefined and no custom engine files were provided. The command '/bin/sh -c npx ...
Read more >docker-compose up issue Using Docker Apple M1
Prisma seems to recognize I am on linux-arm but is unable to ... Undefined means you don't have openssl installed in the container....
Read more >Prisma engines
Learn about Prisma internals and how it works "under the hood". Prisma tools are based on an engine-layer which manages the communication with...
Read more >export node_options=--openssl-legacy-provider windows
On Linux, you need to edit your /etc/ssl/openssl.cnf to un-comment a few lines ... I was encountered with unknown query engine library error...
Read more >M1 MacのDocker上のNestJSでPrismaを動かすまでに詰まっ ...
Error: Unknown binaryTarget linux-arm64-openssl-undefined and no custom ... ENV PRISMA_QUERY_ENGINE_BINARY=/prisma-engines/query-engine ...
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
I am closing the issue, It’s fixed by installing openssl. Thanks
I think the issue is that the Docker image you’re currently using doesn’t ship with
openssl
.Consider a simpler Dockerfile:
Build it via:
docker build -t jkomyno/prisma-alpine .
Open an interactive local session via:
docker run -it @jkomyno/prisma-alpine /bin/sh
Fetch the
openssl
version, if any:Solution
The easiest fix is to drop
alpine
in favor ofslim
, a Debian-based image.Please let us know whether the proposed solution works for you, so we can close this issue.