When deploying to Dokku on DigitalOcean, I get the following error:
``
Invalidprisma.event.findMany()` invocation:
Query engine binary for current platform "debian-openssl-1.1.x" could not be found.
This probably happens, because you built Prisma Client on a different platform.
(Prisma Client looked in "/app/node_modules/@prisma/client/runtime/query-engine-debian-openssl-1.1.x")
You already added the platforms "native", "debian-openssl-1.1.x" 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-client-js/issues/new",
```
(Locally, on MacOS, everything works well).
@prisma/client: preview025
@prisma/cli: preview025
Similar to https://github.com/prisma/prisma2/issues/2015 we really need to find the cause
@iherger Are you using yarn?
@pantharshit00 , yes, using yarn.
This is an intermittent error, and unfortunately, I have no indications as to when it happens and when not. It has reappeared again after upgrading to prisma 2 beta.
Might also be related to https://github.com/prisma/prisma/issues/2082.
Getting the same issue with docker . Not using netlify ;)
I ran into this issue deploying to Heroku as well. I also tried "heroku-postbuild": "yarn prisma generate" which did regenerate the client, but before their cleanup task and did not solve the problem. I assume they are removing binaries during cleanup.
To get around this, I ssh'ed into the box and ran the generate cmd.
@evanheisler For the Heroku issue, please refer here: https://github.com/prisma/prisma/issues/1540. It should not happen and please open a new issue if you are still encountering it. An example Heroku deployment can be found in our end to end test repository: https://github.com/prisma/prisma2-e2e-tests/tree/master/platforms/heroku
@emroot Can you please share your dockerfile. Also, please note that if your host and the docker vm are different environments, you will need to specify both in the binary target so that cli explicitly downloads and persist binary for both OS like so:
generator prisma {
provider = "prisma-client-js"
binaryTargets = ["native","darwin","debian-openssl-1.1.x"]
}
For the yarn issue, we have noticed it many times but still lack a concrete reproduction so that we may patch in our system or otherwise open a PR to yarn to solve the issue. If anyone can provide a reproduction which is reliable enough, please post it here.
Hey @pantharshit00 I'm having the same issue with Docker. My generator looks exactly like the one you showed:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "darwin", "debian-openssl-1.1.x"]
}
My Dockerfile looks like this:
FROM node:12.16.2-alpine
ENV LANG=C.UTF-8
ENV GLIBC_VERSION 2.30-r0
RUN apk add --update curl && \
curl -Lo /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
curl -Lo glibc.apk "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk" && \
curl -Lo glibc-bin.apk "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk" && \
apk add glibc-bin.apk glibc.apk && \
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
apk del curl && \
rm -rf glibc.apk glibc-bin.apk /var/cache/apk/*
WORKDIR /usr/src/app
# install dependencies
COPY package.json .
COPY yarn.lock .
RUN yarn install --frozen-lockfile --no-cache
# copy over source code
COPY prisma ./prisma
COPY src ./src
COPY tsconfig.json ./tsconfig.json
EXPOSE 5000
RUN yarn generate:client
RUN yarn build
CMD ["yarn", "start:prod"]
Shelling into the container, I see there is no query-engine-debian-openssl-1.1.x folder, but there _is_ a query-engine-darwin. I tried just removing the other two binary targets and just having debian-openssl but had the same issue...
@Michael-M-Judd Alpine is not supported by us right now, even if you install glibc on it. Please use node-slim for now or provide your binaries via environment variables: https://github.com/prisma/prisma/issues/1840
@Michael-M-Judd Alpine is not supported by us right now, even if you install glibc on it. Please use node-slim for now or provide your binaries via environment variables: prisma/prisma#1840
I also tried using node-slim and have the exact same error
I have set NODE_MODULES_CACHE to false and I haven't had the issue since.
@Michael-M-Judd Can you please share the dockerfile that you used with node-slim. That way I can try a reproduction. If you can share a git repo with the reproduction, that would be awesome.
I ran across this issue while following along the redwoodjs turotial. The issue was related to the node version. Namely, I solved the issue by switching from node@14 to node@13. To provide more insight, if you haven't done so already, get nvm. Subsequently install the appropriate version with nvm install 13 and switch to it with nvm use 13.
@mateja176 Yeah, we recently hit a nodejs bug. Please read: https://github.com/prisma/prisma/issues/2361
We have implemented a workaround for node 14 and it should work now. I think it will get automatically fixed when redwood updates the Prisma verson
I think i am having related issue.
schema.prisma
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-1.1.x"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
Versions
"dependencies": {
"@nexus/schema": "^0.14.0",
"@prisma/client": "^2.0.1",
"nexus-prisma": "^0.14.0"
},
"devDependencies": {
"@prisma/cli": "^2.0.1",
}
npm 6.14.4
node v12.18.0
OS
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.6
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
Error message
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 "/app/node_modules/@prisma/client/runtime/query-engine-linux-musl")↵↵Files in /app/node_modules/@prisma/client/runtime:↵↵ Dataloader.d.ts↵ browser-chalk.d.ts↵ browser-terminal-link.d.ts↵ browser.d.ts↵ dmmf-types.d.ts↵ dmmf.d.ts↵ error-types.d.ts↵ externalToInternalDmmf.d.ts↵ getLogLevel.d.ts↵ getPrismaClient.d.ts↵ highlight↵ index.d.ts↵ index.js↵ index.js.map↵ mergeBy.d.ts↵ query.d.ts↵ transformDmmf.d.ts↵ utils↵ visit.d.ts↵↵You already added the platform "native" 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-client-js/issues/new
@lauriskuznecovs Can you please open a new issue with a minimal reproduction? Thanks!
Also, try following generator block for alpine:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl"]
}
Thanks, @pantharshit00 seems like it fixed my issue.
I solved this issue for myself by overriding the node.__dirname Webpack setting inside next.config.js.
// node.config.js
module.exports = {
// stuff here
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.node.__dirname = false;
return config;
},
};
This solution was first proposed here.
Related issues:
I am going to close this as its been 3 months now and there is no activity here.
Please reply if you want us to take another look.
Most helpful comment
@lauriskuznecovs Can you please open a new issue with a minimal reproduction? Thanks!
Also, try following generator block for alpine: