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.

Prisma doesn't work on Linux aarch64 (through Docker on Mac M1)

See original GitHub issue

Bug description

I’m trying to run a Prisma application in the Linux Alpine aarch64 through the Docker on my Mac M1

Linux 69b51cb4aba2 5.10.47-linuxkit #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 aarch64 Linux

I’ve already tried to add the binaryTargets on schema.prisma

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "linux-musl", "linux-arm-openssl-1.1.x"]
}

And when I try to run prisma generate on the Docker container it throws the following error:

Error: Unable to require(`/usr/app/node_modules/prisma/libquery_engine-linux-arm-openssl-1.1.x.so.node`)
 Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /usr/app/node_modules/prisma/libquery_engine-linux-arm-openssl-1.1.x.so.node)

How to reproduce

The error will only happen on Mac M1. On Mac with Intel processors, everything works fine.

  1. Clone https://github.com/joaom182/learn-graphql-prisma
  2. Run yarn docker:build
  3. It will throw the following error
#12 1.245 Error: Unable to require(`/usr/app/node_modules/prisma/libquery_engine-linux-arm-openssl-1.1.x.so.node`)
#12 1.245  Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /usr/app/node_modules/prisma/libquery_engine-linux-arm-openssl-1.1.x.so.node)

Expected behavior

Should prisma generate work without binary issues on Linux aarch64

Prisma information

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "linux-musl", "linux-arm-openssl-1.1.x"]
}

generator typegraphql {
  provider           = "typegraphql-prisma"
  output             = "./generated/type-graphql"
  emitTranspiledCode = true
}

model User {
  id       Int      @id @default(autoincrement())
  email    String   @unique
  name     String?
}

Environment & setup

  • OS: Mac OS (M1)
  • Database: PostgresSQL
  • Node.js version: v14.18.0

Prisma Version

prisma                  : 3.0.1
@prisma/client          : 3.0.1
Current platform        : darwin
Query Engine (Node-API) : libquery-engine 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine        : migration-engine-cli 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine    : introspection-core 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary           : prisma-fmt 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash    : 2452cc6313d52b8b9a96999ac0e974d0aedf88db
Studio                  : 0.423.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
joaom182commented, Oct 3, 2021

The workaround that I found to make it work, is changing the base image on Dockerfile, from node:alpine to node:lts

2reactions
spvn87commented, Mar 4, 2022

I posted an interim solution to this for alpine in the duped issue: https://github.com/prisma/prisma/issues/8478#issuecomment-1059559520

Crossposting here because Google brought me here originally and not to the first issue 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue building docker image containing prisma on mac M1
I have a docker image that contains prisma and runs on node16 alpine. The container mounts fine, but when I try to run...
Read more >
ARM64 Support - LocalStack Docs
Describes the support for the ARM64 CPU architecture in LocalStack. ... issues with the ARM64 image by filing an issue if you experience...
Read more >
twistcli - Prisma Cloud - Palo Alto Networks
Prisma Cloud ships a command-line configuration and control tool known as twistcli. It is supported on Linux, macOS, and Windows.
Read more >
Installation | Manual - Deno
Deno works on macOS, Linux, and Windows. ... On macOS, both M1 (arm64) and Intel (x64) executables are provided. On Linux ... Using...
Read more >
Dockerize Next.js With Prisma App_云O生 - DevPress - CSDN
The Apple M1 chip, docker, and Prisma don't seem to get along very well. ... Using any other Node image may work but...
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