Prisma-client-js: Error with Preview 17 query engine distribution

Created on 30 Nov 2019  路  11Comments  路  Source: prisma/prisma-client-js

When upgrading to preview17.2 (from 16.2) I am getting

Generating Photon.js to ./node_modules/@prisma/photon
__dirname /usr/src/app/node_modules/@prisma/photon/generator-build
/usr/src/app/node_modules/@prisma/photon/generator-build
2019-11-30T10:13:39.035Z generateClient Copying /usr/src/app/node_modules/prisma2/build/query-engine-debian-openssl-1.1.x to /usr/src/app/server/node_modules/@prisma/photon/runtime/query-engine-debian-openssl-1.1.x
Error: Error: Error: ENOENT: no such file or directory, copyfile '/usr/src/app/node_modules/prisma2/build/query-engine-debian-openssl-1.1.x' -> '/usr/src/app/server/node_modules/@prisma/photon/runtime/query-engine-debian-openssl-1.1.x'
    at GeneratorProcess.handleResponse (/usr/src/app/node_modules/prisma2/build/index.js:182160:35)
    at LineStream.<anonymous> (/usr/src/app/node_modules/prisma2/build/index.js:182138:26)
    at LineStream.emit (events.js:210:5)
    at LineStream.EventEmitter.emit (domain.js:478:20)
    at addChunk (_stream_readable.js:326:12)
    at readableAddChunk (_stream_readable.js:301:11)
    at LineStream.Readable.push (_stream_readable.js:235:10)
    at LineStream.Transform.push (_stream_transform.js:150:32)
    at LineStream.module.exports.2514.LineStream._pushBuffer (/usr/src/app/node_modules/prisma2/build/index.js:64185:23)
    at LineStream.module.exports.2514.LineStream._transform (/usr/src/app/node_modules/prisma2/build/index.js:64177:10)
error Command failed with exit code 1.

while on preview16.2 it works like a charm

Downloading https://s3-eu-west-1.amazonaws.com/prisma-native/master/b72fd0a786adc77ba6c61d0a9637ff0371e433b0/linux-glibc-libssl1.1.0/prisma.gz to /usr/src/app/node_modules/prisma2/build/query-engine-linux-glibc-libssl1.1.0
Generating Photon.js to /usr/src/app/server/node_modules/@prisma/photon
2019-11-30T10:30:36.553Z generateClient Copying /usr/src/app/node_modules/prisma2/build/query-engine-linux-glibc-libssl1.1.0 to /usr/src/app/server/node_modules/@prisma/photon/runtime/query-engine-linux-glibc-libssl1.1.0
Done in 11.60s

Most notable difference: on 16.2 it's loading query-engine-linux-glibc-libssl1.1.0 while on 17.2 it tries to fetch query-engine-debian-openssl-1.1.x.

Both instances are using Heroku/heroku:18 docker image based on Ubuntu 18.4, and are running on Heroku. I hope this helps 馃檪

bu0-needs-info kinbug

All 11 comments

preview017 changed the binary names, see https://github.com/prisma/prisma2/releases/tag/2.0.0-preview017, so the new name is expected. The error you are seeing of course is not.

Where does your project live - /usr/src/app/server/ or /usr/src/app/?
Any special ENV variables or config in your schema?

I think I saw a similar issues before, so @pantharshit00 will probably be able to actually help you out next Monday.

prisma2 is required as a peerDependency for @prisma/photon so that we can copy the binaries in the build folder. Can you please make sure that you have prisma2 installed a dependency for this project?

@pantharshit00 I believe I have prisma2 installed - it's a development dependency. Wouldn't I be unable to run prisma generate if it weren't installed?

it's a development dependency.

I think Heroku prunes devDependencies so it might also be removing the binary the need to be copied.

Can you share your DockerFile so that I can try this locally once?

@pantharshit00 I have the exact same setup - same dependencies, same development dependencies - with the earlier version as I have with the later. I am pretty convinced that is not the problem.

https://github.com/maticzav/emma-cli/blob/master/Dockerfile

I'm seeing an issue that might have a similar cause as this:

$ npx prisma2 generate
Error: Error: Command failed with ENOENT: /home/dan/prisma2/node_modules/prisma2/query-engine-debian-openssl-1.1.x cli --dmmf
spawn /home/dan/prisma2/node_modules/prisma2/query-engine-debian-openssl-1.1.x ENOENT

This is on WSL2 (Ubuntu)

That might very well be a separate issue @djskinner, please create a new issue and include all available information. Thanks.

@pantharshit00 @janpio any luck with the issue?

Sorry I didn't get to it earlier. You need to update your docker setup a bit. You don't require to configure the output now as @prisma/photon package is now in the package.json and yarn workspace will handle it. Right now the output node_modules is in submodues's node_modules but our script is trying to fetch binary from the root node_modules.

I made a small PR fixing this setup: https://github.com/maticzav/emma-cli/pull/219
image

@maticzav Can this be closed now?

It can. Thank you for helping me 馃檪

Was this page helpful?
0 / 5 - 0 ratings