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.

Query engine binary for current platform "linux-musl" could not be found.

See original GitHub issue

Hello Prisma team,

I have an issue when run app on docker and got runtime error like this.

My app env: typescript, nextjs.

> next start

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5
PrismaClientInitializationError2 [PrismaClientInitializationError]: Query engine binary for current platform "linux-musl" could not be found.
This probably happens, because you built Prisma Client on a different platform.
(Prisma Client looked in "/query-engine-linux-musl")

Searched Locations:

  /.prisma/client
  ..\src\generated\client
  /
  /
  /
  /tmp/prisma-engines
  /

You already added the platform "linux-musl" to the "generator" block
in the "schema.prisma" file as described in https://pris.ly/d/client-generator,
but something went wrong. That's suboptimal.

Please create an issue at https://github.com/prisma/prisma/issues/new
    at cb (/app/.next/server/pages/api/generate-code.js:892:539)
    at async Object.GetPlan (/app/.next/server/pages/api/generate-code.js:167:16)
    at async module.exports.YMAs.__webpack_exports__.default (/app/.next/server/pages/api/generate-code.js:464:20)
    at async apiResolver (/app/node_modules/next/dist/next-server/server/api-utils.js:8:1)
    at async Server.handleApiRequest (/app/node_modules/next/dist/next-server/server/next-server.js:66:462)
    at async Object.fn (/app/node_modules/next/dist/next-server/server/next-server.js:58:580)
    at async Router.execute (/app/node_modules/next/dist/next-server/server/router.js:25:67)
    at async Server.run (/app/node_modules/next/dist/next-server/server/next-server.js:68:1042)
    at async Server.handleRequest (/app/node_modules/next/dist/next-server/server/next-server.js:32:504) {
  clientVersion: '2.24.1',
  errorCode: undefined
}

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
mytharchercommented, Aug 13, 2021

You may have a check of your schema.prisma file:

generator client {
    provider      = "prisma-client-js"
    binaryTargets = ["native", "linux-musl"]
}

And you could add the "linux-musl" to binaryTargets field. This step fixes my building for docker image.

1reaction
malteneusscommented, Apr 28, 2022

For those that encounter that “Query engine binary for current platform “linux-musl” could not be found.” issue when packaging Prisma within Docker, i’ve added a solution workaround Gist here: https://gist.github.com/malteneuss/a7fafae22ea81e778654f72c16fe58d3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dockerize NextJS Application with Prisma - Stack Overflow
I've found this solution with some workarounds: ... Query engine binary for current platform "linux-musl" could not be found." }.
Read more >
Query engine (Concepts) - Prisma
Prisma's query engine manages the communication with the database when using Prisma Client. ... You can find an overview of all supported platforms...
Read more >
Hi I m having difficulty in a project setup with Prisma Dock
Can anyone help me with this error? ... Query engine library for current platform "linux-musl" could not be found. app-api | You incorrectly ......
Read more >
PyOxidizer - Release 0.23.0 Gregory Szorc
Serialize Python resource data into an efficient binary data structure ... like Could not find platform independent libraries <prefix> or ...
Read more >
Query Engine Binary For Current Platform "Debian-Openssl ...
X" Could Not Be Found. Since I can't do this override I have to manually edit the default-lambda code using a custom ...
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