prisma: Error: Unknown binaryTarget linux-arm64-openssl-undefined and no custom engine files were provided
@janpio I've recreated it with the following minimal setup.
Dockerfile
ARG FUNCTION_DIR="/var/task" FROM node:16-slim # Include global arg in this stage of the build ARG FUNCTION_DIR WORKDIR ${FUNCTION_DIR} COPY . ${FUNCTION_DIR} RUN yarn add prisma RUN yarn prisma generate
prisma.schema
// This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema generator client { provider = "prisma-client-js" binaryTargets = ["rhel-openssl-1.0.x", "linux-arm64-openssl-1.0.x"] } datasource db { provider = "mongodb" url = env("DATABASE_URL") } model User { objectID String @id @default(auto()) @map("_id") @db.ObjectId }
docker-compose.yml
version: "3.9" services: api: build: . volumes: - ./:/var/task
When running
docker compose build
you should get this errorError: Unknown binaryTarget linux-arm64-openssl-undefined and no custom engine files were provided #0 1.446 error Command failed with exit code 1.
_Originally posted by @jcampbell05 in https://github.com/prisma/prisma/issues/861#issuecomment-1310206111_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (4 by maintainers)
for me it worked using node:16-slim version :
Hi @damsog, manually adding
openssl
is no longer necessary in newer Prisma versions. Please installprisma@4.10.1
and try again without the additional DockerRUN
command you’ve mentioned above.@hotrungnhan,
prisma@4.10.1
natively supports Linux Alpine onarm64
😃So this error is unrelated to ARM and is caused by a lack of an installed SSL library. Some slim Docker images no longer come with a SSL library installed by default in order to keep the image as small as possible. This is why switching to a full sized image resolves this issue.
The fix is to simply install a SSL library.
Unfortunately the error from Prisma doesn’t provide any context that this is the issue. So I would suggest the following change:
@janpio I’ve spent several hours trying to replicate this, but I’m not getting this error anymore. I haven’t changed anything on my end, so I’m not sure whether some other dependency was updated, or whether my computer was just caching something poorly.
But in either scenario, you should be free to close this. I can create a new ticket if I run into similar issues in the future.
@cesarvspr Yes I had to add the following line to my Dockerfile when using the
node:16-slim
image.You may need to adjust this command for your distro if it uses another package manager.
i tried
RUN apk add --update openssl && apk add --update libressl-dev && rm -rf /var/cache/apk/*
to install openssl and libressl-dev but still didn’t work for alpine, had to change the base image to slim instead@JameelKhan9 you also need to install
openssl
as Prisma needs the command line tool that installs to determine the version if it cannot do it via the headers.