Prisma: Can not Install: Missing query-engine-debian-openssl-1.1.x

Created on 18 Feb 2020  路  24Comments  路  Source: prisma/prisma

Env info:

Running Ubuntu 18.04 in Windows 10 WSL 2.

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

Globally installed prisma2:
[email protected], binary version: f608db3b9e4f50f9a384356e532357b0a525969a

package.json

  "devDependencies": {
    "prisma2": "^2.0.0-preview022",
    "ts-node": "^8.6.2",
    "typescript": "^3.7.5"
  },
  "dependencies": {
    "@prisma/client": "^2.0.0-preview022"
  }

Error

> @prisma/[email protected] postinstall [project]/node_modules/@prisma/client
> node scripts/postinstall.js

Error: Error: Command failed with ENOENT:[project]/node_modules/prisma2/query-engine-debian-openssl-1.1.x --enable_raw_queries cli 
--dmmf
spawn [project]/node_modules/prisma2/query-engine-debian-openssl-1.1.x ENOENT

Reproduce:

Run: npm install

> [email protected] install [project]/node_modules/prisma2
> node download-build/index.js

> Downloading Prisma engines for debian-openssl-1.1.x [====================] 100%


> @prisma/[email protected] postinstall [project]/node_modules/@prisma/client
> node scripts/postinstall.js

Error: Error: Command failed with ENOENT:[project]/node_modules/prisma2/query-engine-debian-openssl-1.1.x --enable_raw_queries cli 
--dmmf
spawn [project]/node_modules/prisma2/query-engine-debian-openssl-1.1.x ENOENT
npm WARN [email protected] No repository field.

added 11 packages from 42 contributors and audited 11 packages in 7.457s
found 0 vulnerabilities

You can see debian-openssl-1.1.x was apparently saved successfully but after the operation, I do not see it in the node_modules/prisma2 directory:

[user]@DESKTOP: [project]/node_modules/prisma2$ ls -lah
total 12K
drwxrwxrwx 1 [user] [user]     512 Feb 18 17:22 .
drwxrwxrwx 1 [user] [user]     512 Feb 18 17:22 ..
-rwxrwxrwx 1 [user] [user]     1.1K Oct 26  1985 README.md
drwxrwxrwx 1 [user] [user]     512 Feb 18 17:22 build
drwxrwxrwx 1 [user] [user]     512 Feb 18 17:22 download-build
-rwxrwxrwx 1 [user] [user]      4 Feb 18 17:22 download-done
-rwxrwxrwx 1 [user] [user]      4.1K Feb 18 17:22 package.json
drwxrwxrwx 1 [user] [user]     512 Feb 18 17:22 prisma-client

Running as sudo will produce the same error.

bu0-needs-info kinbug statuneeds-action WSL binary engine-not-found windows

Most helpful comment

@husseinraoouf, See #2305

All 24 comments

Quickly tried to reproduce this on WSL (1, only using super stable software on this machine... 馃し鈥嶁檧 ), and could not - there the binaries were successfully downloaded and a Prisma Client could be generated with the steps mentioned in https://github.com/prisma/prisma2/blob/master/docs/getting-started/start-from-scratch-with-empty-db/quickstart-prisma-migrate.md (which you linked to in Slack).

@pantharshit00 please try to reproduce this with WSL2 (https://docs.microsoft.com/en-us/windows/wsl/wsl2-install).

(@KyleTryon If you are not depending on WSL, Prisma works fine in normal Windows. It will download different binaries, that should work just fine. Maybe that is a temporary workaround for you.)

I uninstalled ubuntu and reinstalled it for a fresh WSL 2 box and tried again. This time I got a different error, then re-ran the installation with no error shown.

user@DESKTOP:[project]$ sudo npm install

> [email protected] install [project]/node_modules/prisma2
> node download-build/index.js

> Downloading Prisma engines for debian-openssl-1.1.x [====================] 100%




> @prisma/[email protected] postinstall [project]/node_modules/@prisma/client
> node scripts/postinstall.js

GeneratorError: Error: EPERM: operation not permitted, copyfile '[project]/node_modules/prisma2/query-engine-debian-openssl-1.1.x' -> '[project]/node_modules/@prisma/client/runtime/query-engine-debian-openssl-1.1.x'
    at GeneratorProcess.handleResponse ([project]/node_modules/prisma2/build/index.js:2:177310)
    at LineStream.<anonymous> ([project]/node_modules/prisma2/build/index.js:2:176926)
    at LineStream.emit (events.js:321:20)
    at LineStream.EventEmitter.emit (domain.js:485:12)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:273:9)
    at LineStream.Readable.push (_stream_readable.js:214:10)
    at LineStream.Transform.push (_stream_transform.js:152:32)
    at LineStream._pushBuffer ([project]/node_modules/prisma2/build/index.js:2:840724)
    at LineStream._transform ([project]/node_modules/prisma2/build/index.js:2:840543) {
  code: -32000,
  data: null
}

You can now start using Prisma Client in your code:

'''
import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')

const prisma = new PrismaClient()
'''

Explore the full API: http://pris.ly/d/client

^C
user@DESKTOP:[project]$ sudo npm install
npm WARN [email protected] No repository field.

audited 11 packages in 0.47s
found 0 vulnerabilities

user@DESKTOP:[project]$ 

Everything is now working fine 馃憤 Was able to run:

npx prisma2 migrate save --name 'init' --experimental
npx prisma2 migrate up --experimental
npx prisma2 generate
npx ts-node index.ts

Thanks everyone 馃檹

Hm, we might want to investigate this anyway - the EPERM error also is not the best experience ;)

sudo npm i -g prisma2

Same problem on ArchLinux. I needed to reinstall it.

Same problem inside docker

Error: Error: Command failed with ENOENT: /app/node_modules/prisma2/query-engine-debian-openssl-1.1.x --enable-raw-queries cli dmmf
spawn /app/node_modules/prisma2/query-engine-debian-openssl-1.1.x ENOENT

Also on Windows an WSL @unlight? If not, please open a new issue and include all available information so we can try to reproduce this.

Can you all please try again with the latest version preview024?

@pantharshit00 The preview024 version is also broken with docker. It gives the same error.

@krn0x2 Can you please post your dockerfile here?

same issue for alpine 3.11 and 2.0.0-preview024 and 2.0.0-preview025:

$ cat Dockerfile:

FROM alpine:3.11.3

RUN apk update \
    && apk add --no-cache ca-certificates \
    && update-ca-certificates

RUN apk add --no-cache --virtual .build-deps \
        build-base \
        git \
        python \
    && apk add --no-cache \
        nodejs-current \
        nodejs-npm \
        openssl \
    && npm install \
    && apk del .build-deps

docker build and docker run:

Error: Error: Command failed with ENOENT: /houston/node_modules/prisma2/query-engine-debian-openssl-1.1.x --enable-raw-queries cli dmmf
spawn /houston/node_modules/prisma2/query-engine-debian-openssl-1.1.x ENOENT
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `npx prisma2 generate && babel src -d dist --copy-files`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-03-27T15_10_42_738Z-debug.log
node -v
v13.8.0
npm --version
6.13.7
cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.3
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

openssl version
OpenSSL 1.1.1d  10 Sep 2019

@pantharshit00 please take a look ^

if i add to my dockerfile:

# Download and install glibc
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/*

from https://github.com/prisma/prisma2/issues/702#issuecomment-569778198

it works!

@andriisoldatenko We do not compile for alpine yet so I would advice you to use a different docker image.

I tried andriisoldatenko suggested above with node:12-alpine, however doesn't work for me.

My try with node:12-alpine got this error:
(4/4) Installing curl (7.67.0-r0) Executing busybox-1.31.1-r9.trigger Executing ca-certificates-20191127-r1.trigger OK: 9 MiB in 20 packages % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:-100 451 100 451 0 0 799 0 --:--:-- --:--:-- --:-100 451 100 451 0 0 799 0 --:--:-- --:--:-- --:--:-- 798 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:-100 9 100 9 0 0 38 0 --:--:-- --:--:-- --:--:-- 38 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:-100 9 100 9 0 0 48 0 --:--:-- --:--:-- --:--:-- 48 ERROR: glibc-bin.apk: IO ERROR

@pantharshit00 I tried node:slim, it works for my nodejs app with prisma2. However, the image is still kind of big. Is there a way that node:apline could work for nodesjs app with prisma2 Docker build? What missing dependices should I add?
For node:12-alpine, my Docker build got error:
Step 27/31 : RUN npx prisma2 generate ---> Running in fb0918ffb9ed Error: Error: Command failed with ENOENT: /usr/local/lib/node_modules/@prisma/cli/query-engine-debian-openssl-1.1.x --enable-raw-queries cli dmmf spawn /usr/local/lib/node_modules/@prisma/cli/query-engine-debian-openssl-1.1.x ENOENT The command '/bin/sh -c npx prisma2 generate' returned a non-zero code: 1

I even added
RUN apk update && apk add openssl
at step 22.

@yleigh You will need to add glibc as binaries are based on that. Alpine only comes with musl and rust with musl is not that straight forward so it may take some time for us to release alpine support so no timeline on that.

A community member posted steps that worked for them here: https://github.com/prisma/prisma/issues/702#issuecomment-569778198

or you can compile the binaries for Alpine as one of the other community members did: https://github.com/prisma/prisma/issues/702#issuecomment-599121308

Also having the same issue inside node:13 and node:13-slim

@Tenkir Can you please share your Dockerfile?

Getting the same issue, it's trying to download musl-openssl-1.1.x from this url: https://binaries.prisma.sh/master/afd294205618b1c825b013ba6f5a6ebe4aa4a514/musl-openssl-1.1.x/query-engine.gz but the url returns NoSuchKey error
image

With node:slime, in Dockerfile I added this and fixed the issue:
RUN apt-get -qy update && apt-get -qy install openssl

I am tested this out and it works:
image

I used the following Dockerfile:

FROM node:12-alpine

ENV DEBUG *


RUN npm install -g @prisma/cli

RUN prisma version

Also, the binaries are not stored at https://binaries.prisma.sh/master/afd294205618b1c825b013ba6f5a6ebe4aa4a514/musl-openssl-1.1.x/query-engine.gz that scheme is wrong. Url from the correct schema: https://binaries.prisma.sh/master/0c2ec197653b278b2978845ef958db88824cd82e/linux-musl/migration-engine.gz

I have the same issue in nixos

when trying to run npx prisma migrate save --name init --experimental

Error: Get config Error: Command failed with ENOENT: [project folder]/node_modules/@prisma/cli/query-engine-debian-openssl-1.1.x cli get-config
spawn [project folder]/node_modules/@prisma/cli/query-engine-debian-openssl-1.1.x ENOENT

@husseinraoouf, See #2305

Was this page helpful?
0 / 5 - 0 ratings

Related issues

macrozone picture macrozone  路  31Comments

malekjaroslav picture malekjaroslav  路  53Comments

malekjaroslav picture malekjaroslav  路  42Comments

timsuchanek picture timsuchanek  路  26Comments

internalfx picture internalfx  路  60Comments