Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
KyleTryon opened this issue Feb 18, 2020 · 28 comments
Closed

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

KyleTryon opened this issue Feb 18, 2020 · 28 comments
Assignees
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: binary topic: engine-not-found topic: windows topic: WSL

Comments

@KyleTryon
Copy link

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:
prisma2@2.0.0-preview022, 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/client@2.0.0-preview022 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

> prisma2@2.0.0-preview022 install [project]/node_modules/prisma2
> node download-build/index.js

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


> @prisma/client@2.0.0-preview022 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 postsnail-core@1.0.0 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.

@janpio
Copy link
Member

janpio commented Feb 18, 2020

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.)

@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. labels Feb 18, 2020
@KyleTryon
Copy link
Author

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

> prisma2@2.0.0-preview022 install [project]/node_modules/prisma2
> node download-build/index.js

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




> @prisma/client@2.0.0-preview022 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 postsnail-core@1.0.0 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 🙏

@janpio
Copy link
Member

janpio commented Feb 19, 2020

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

@janpio janpio reopened this Feb 19, 2020
@TSTsankov
Copy link

sudo npm i -g prisma2

@TheAifam5
Copy link

TheAifam5 commented Feb 23, 2020

Same problem on ArchLinux. I needed to reinstall it.

@unlight
Copy link

unlight commented Mar 8, 2020

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

@janpio
Copy link
Member

janpio commented Mar 8, 2020

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.

@pantharshit00
Copy link
Contributor

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

@pantharshit00 pantharshit00 added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Mar 17, 2020
@krn0x2
Copy link

krn0x2 commented Mar 25, 2020

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

@pantharshit00
Copy link
Contributor

pantharshit00 commented Mar 26, 2020

@krn0x2 Can you please post your dockerfile here?

@andriisoldatenko
Copy link

andriisoldatenko commented Mar 27, 2020

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! houston-api@1.0.0 build: `npx prisma2 generate && babel src -d dist --copy-files`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the houston-api@1.0.0 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

@andriisoldatenko
Copy link

@pantharshit00 please take a look ^

@andriisoldatenko
Copy link

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 #702 (comment)

it works!

@pantharshit00
Copy link
Contributor

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

@yleigh
Copy link

yleigh commented Apr 6, 2020

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

@yleigh
Copy link

yleigh commented Apr 6, 2020

@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.

@pantharshit00
Copy link
Contributor

@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: #702 (comment)

or you can compile the binaries for Alpine as one of the other community members did: #702 (comment)

@Tenkir
Copy link

Tenkir commented Apr 20, 2020

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

@pantharshit00
Copy link
Contributor

@Tenkir Can you please share your Dockerfile?

@emroot
Copy link

emroot commented May 13, 2020

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

@yleigh
Copy link

yleigh commented May 13, 2020

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

@pantharshit00
Copy link
Contributor

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

@husseinraoouf
Copy link

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

@pantharshit00
Copy link
Contributor

pantharshit00 commented May 24, 2020

@husseinraoouf, See #2305

@Jolg42
Copy link
Contributor

Jolg42 commented Mar 18, 2021

Closing as old.

Please open a new issue if you experience this with a more recent version of Prisma.

@Jolg42 Jolg42 closed this as completed Mar 18, 2021
@gustawdaniel
Copy link

In my case arch these commands helped:

rm -rf node_modules
npm i
npx prisma generate

@saharshg
Copy link

Downloading Prisma engines for Node-API for debian-openssl-1.1.x [ ] 0%Error: request to https://binaries.prisma.sh/all_commits/ceb5c99003b99c9ee2c1d2e618e359c14aef2ea5/debian-openssl-1.1.x/prisma-fmt.gz.sha256 failed, reason: unable to verify the first certificate

Still not resolved in prisma version 4.9.0, Ubuntu 20.04.5 LTS

@Jolg42
Copy link
Contributor

Jolg42 commented Jan 19, 2023

@saharshg I think I might be able to help you, but could you open a new issue here first?
Please make sure to mention your Node.js version and environment info in the template.

@prisma prisma locked as resolved and limited conversation to collaborators Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: binary topic: engine-not-found topic: windows topic: WSL
Projects
None yet
Development

No branches or pull requests