question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Unknown binaryTarget linux-arm64-openssl-undefined and no custom engine files were provided

See original GitHub issue
    @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 error

Error: 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_

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:8

github_iconTop GitHub Comments

9reactions
shide1989commented, Dec 4, 2022

for me it worked using node:16-slim version :

FROM node:16-slim
RUN apt-get update
RUN apt-get install -y openssl
6reactions
jcampbell05commented, Nov 14, 2022

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:

  • Change the name of the Linux based package to indicate the number in the name is supposed to represent the version of the locally installed SSL library i.e “linux-rhel-ssl-1.0.0”. Wasn’t clear that this version number was related to that.
  • When a linux library has been selected (Either manually or automatically via “native”) then if a SSL library isn’t installed rather than returning “undefined” as the version number. Throw an error indicating that they lack a SSL library.
Read more comments on GitHub >

github_iconTop Results From Across the Web

docker-compose up issue Using Docker Apple M1
When you run the prisma generate command, prisma seems to uses the query engine , but it needs to find the proper binary...
Read more >
NestJS + Redis + Postgres Local Development With Docker ...
Error : Unknown binaryTarget linux-arm64-openssl-undefined and no custom engine files were provided. This is a open issue and on Prisma's ...
Read more >
npx prisma initでUnknown binaryTarget linux-arm64-openssl ...
dockerでgraphqlサーバーを作ろうとしていた際に発生したエラーの対応備忘録です。 Unknown binaryTarget linux-arm64-openssl-undefinedが発生 ...
Read more >
Environment variables reference - Prisma
This page gives an overview of all environment variables available for use. ... There are however situations where you may want to use...
Read more >
M1 MacのDocker上のNestJSでPrismaを動かすまでに詰まっ ...
Error : Unknown binaryTarget linux-arm64-openssl-undefined and no custom binaries were provided. やったこと. npx prisma init.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found