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

Error: Get config: Unable to establish a connection to query-engine-node-api library #13717

Closed
PiecePaperCode opened this issue Jun 8, 2022 · 32 comments
Assignees
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. topic: error handling
Milestone

Comments

@PiecePaperCode
Copy link

PiecePaperCode commented Jun 8, 2022

$/prisma/starter$ npx prisma generate
Prisma schema loaded from prisma/schema.prisma
Error: Get config: Unable to establish a connection to query-engine-node-api library

Prisma CLI Version : 3.15.1-dev.1

How to Reproduce
OS: 22.04 Ubuntu
Node: 16.15.1
Follow these instructions. https://www.prisma.io/docs/getting-started/quickstart#1-download-the-starter-project
Switch to latest possible release: 3.15.1-dev.1 as per today.

What have i tried so far
Switching databases sqlite, postgres
Switching node from 16 to 17.
using 3.13 3.14 gives me this error

/snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /lib/x86_64-linux-gnu/libcrypto.so.3)

in ubuntu i could not figure out how to install GLIBC_2.33
tying with npm and yarn

@janpio janpio added the team/schema Issue for team Schema. label Jun 8, 2022
@janpio
Copy link
Member

janpio commented Jun 8, 2022

Error message is from our new error reporting code from @jkomyno:

reason: 'Unable to establish a connection to query-engine-node-api library',

@janpio
Copy link
Member

janpio commented Jun 8, 2022

To confirm:
Using 3.14.0 you are getting a different error message around GLIBC?

@irfanabdnst
Copy link

irfanabdnst commented Jun 9, 2022

I got this error when using 3.14.0 and 3.13.0
libssl.so.1.1: cannot open shared object file: No such file or directory

I'm also using Ubuntu 22.04

@PiecePaperCode
Copy link
Author

PiecePaperCode commented Jun 9, 2022

i confirm using version 3.13.x 3.14.x gives this error

/snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /lib/x86_64-linux-gnu/libcrypto.so.3)

when using 3.15 gives the Config Error described above.

in bouth cases making prisma work on ubuntu 22.04 is not possible.

@janpio
Copy link
Member

janpio commented Jun 9, 2022

@irfanabdnst Please create a new issue providing all the info the bug issue template asks for. Thanks.

@janpio janpio added topic: error reporting Issues created via Prisma's CLI Crash Reporting team/client Issue for team Client. topic: error handling and removed topic: error reporting Issues created via Prisma's CLI Crash Reporting labels Jun 9, 2022
@pantharshit00
Copy link
Contributor

pantharshit00 commented Jun 9, 2022

Looks like you are using snap to either install Node.js or openssl or maybe even glibC. Since snaps are sandboxes we can't dynamically link to required runtime libraries and so it will throw out that error. So please try installing these libs using apt:

sudo apt install openssl openssl-dev libc6 

If that doesn't work, install node.js via a version manager like fnm or use apt(https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions)

@PiecePaperCode
Copy link
Author

https://github.com/nodesource/distributions/blob/master/README.md

# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

Ok the snap version of node is not compatible with prisma.
Its going to trap ubuntu users who install almost everything with snap.

@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 Jun 9, 2022
@janpio
Copy link
Member

janpio commented Jun 9, 2022

We want to keep this open for the bug with the error reporting that you also reported. Thanks for your help in confirming that this was caused by the snap thingie.

@jkomyno
Copy link
Contributor

jkomyno commented Jun 27, 2022

Hi @PiecePaperCode, to summarise, this issue was due an incompatibility between your system's snap, as highlighted in this comment.
A related issue is that the current error message can be somewhat obscure and misleading. We closed it with this PR.

Tomorrow we will release a new major version that will contain improvements such as the following error message that tries to explain which connecting to the query-engine-node-api library failed:

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Get Config: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
Details: Unable to require(`/home/prisma/.nvm/versions/node/v16.15.1/lib/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node`)
 libssl.so.1.1: cannot open shared object file: No such file or directory

Prisma CLI Version : 3.16.0-dev.102

Please let us know if we can close this issue then :)

@cmwhited

This comment was marked as outdated.

@janpio

This comment was marked as outdated.

@janpio janpio added this to the 4.0.0 milestone Jun 27, 2022
@cmwhited

This comment was marked as outdated.

@janpio

This comment was marked as outdated.

@cmwhited

This comment was marked as outdated.

@shtse8
Copy link

shtse8 commented Jul 8, 2022

Hi @PiecePaperCode, to summarise, this issue was due an incompatibility between your system's snap, as highlighted in this comment. A related issue is that the current error message can be somewhat obscure and misleading. We closed it with this PR.

Tomorrow we will release a new major version that will contain improvements such as the following error message that tries to explain which connecting to the query-engine-node-api library failed:

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Get Config: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
Details: Unable to require(`/home/prisma/.nvm/versions/node/v16.15.1/lib/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node`)
 libssl.so.1.1: cannot open shared object file: No such file or directory

Prisma CLI Version : 3.16.0-dev.102

Please let us know if we can close this issue then :)

I still have this issue, which new version can fix it?

Error: Get Config: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
Details: Unable to require(`/home/shtse8/project/node_modules/.pnpm/prisma@4.0.0/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node`)
 libssl.so.1.1: cannot open shared object file: No such file or directory

Prisma CLI Version : 4.0.0

@janpio
Copy link
Member

janpio commented Jul 8, 2022

There is no new version that can fix this, as this is a problem on your system. See the instructions on how to fix here: #13717 (comment)

@aniwn88480857
Copy link

$ npm-run-all build-tracker build-geo build-db build-app
$ rollup -c rollup.tracker.config.js

tracker/index.js → public/umami.js...
created public/umami.js in 359ms
$ node scripts/build-geo.js
Saved geo database: E:\my\umami-master\umami-master\public\geo\GeoLite2-Country.
mmdb
$ npm-run-all copy-db-files build-db-client
$ node scripts/copy-db-files.js
internal/modules/cjs/loader.js:818
throw err;
^

Error: Cannot find module 'fs-extra'
Require stack:

  • E:\my\umami-master\umami-master\scripts\copy-db-files.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (E:\my\umami-master\umami-master\scripts\copy-db-files
    .js:2:13)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js
    :60:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'E:\my\umami-master\umami-master\scripts\copy-db-files.js
    ' ]
    }
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
    and.
    ERROR: "copy-db-files" exited with 1.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
    and.
    ERROR: "build-db" exited with 1.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
    and.

@aniwn88480857
Copy link

Prisma schema loaded from prisma\schema.prisma
Error: Get config: Unable to establish a connection to query-engine-node-api lib
rary

Prisma CLI Version : 3.15.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.
ERROR: "build-db-client" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.
ERROR: "build-db" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.

@shtse8
Copy link

shtse8 commented Jul 9, 2022

There is no new version that can fix, as this is a problem on your system. See the instructions on how to fix here: #13717 (comment)

It turns out that cannot generate scheme without root permission in linux. I finally can generate it with root. I don't know how to make it work without root permission.

@janpio
Copy link
Member

janpio commented Jul 9, 2022

@aniwn88480857 Your first post looks completely unrelated to Prisma. Your second one is an old version that does not show the full error message, please upgrade to Prisma 4.0.0.

@shtse8 That is not a known limitation, and probably has to do with how you installed your node or application. If the error persists, please open a discussion here in Github and provide more information so Support can take a look. Thanks.

@kaykhan
Copy link

kaykhan commented Jul 18, 2022

Having an issue with prisma on a new laptop ubuntu 22.04

Error: Get Config: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
Details: Unable to require(`/home/kay/checkpoint/nft-api/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node`)
 libssl.so.1.1: cannot open shared object file: No such file or directory
 
 Prisma CLI Version : 4.0.0

I checked my node.js is not installed via snap, instead installed via nvm

whereis node
node: /home/kay/.nvm/versions/node/v16.16.0/bin/node

whereis openssl
openssl: /usr/bin/openssl /home/linuxbrew/.linuxbrew/bin/openssl /usr/share/man/man1/openssl.1ssl.gz

any ideas?

@mirandaa1

This comment was marked as off-topic.

@kaykhan

This comment was marked as off-topic.

@mirandaa1

This comment was marked as off-topic.

@ivan-kleshnin
Copy link

ivan-kleshnin commented Jul 29, 2022

Same issue in Docker

FROM node:16.13-alpine
...
RUN apk add --update openssl openssl-dev libc6-compat
...
===
Get Config: Unable to establish a connection to query-engine-node-api library. 
It seems there is a problem with your OpenSSL installation!

If someone finds a solution for Alpine images – please share.

@janpio
Copy link
Member

janpio commented Jul 29, 2022

@ivan-kleshnin There should be further output with the actual error message that provides the details what is going wrong in your case.

@ivan-kleshnin
Copy link

@janpio here's the rest of the message, thank you for responding:

#0 347.2 Details: Unable to require(`/usr/src/app/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
#0 347.2  Error relocating /usr/src/app/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node: 
__res_init: symbol not found
#0 347.2 Prisma CLI Version : 4.1.1
#0 347.2 error Command failed with exit code 1.

@janpio
Copy link
Member

janpio commented Jul 30, 2022

Ugh, that one is new. Can you please open a new issue for this and fill the full template? We should try to reproduce this and understand what exactly is going on.

@gbgustavobraga
Copy link

i was having this simple problem, >>> sudo su npx migrate dev....

@c43721
Copy link

c43721 commented Aug 16, 2022

@janpio

Ugh, that one is new. Can you please open a new issue for this and fill the full template? We should try to reproduce this and understand what exactly is going on.

While I don't have a template for you unfortunately, I was encountering this error in my CI.

In my project, I build a docker image using node:16-slim as a base image, where I generate my prisma types.

For my runner layer, I was using node:16-buster-slim. I think there's something missing in the node:16-slim image. I have many checks from CI that are green with the same images, but have failed since I started including the prisma files on July 10th. I wasn't using prisma before then, so I assume that on June 8th this hasn't worked. For docker users, it seems like using node:16 or your favorite flavor of node should do the trick.

I hope this gives you some more detail!

@samwiskow
Copy link

M1 mac
MacOS 12.4 (21F79)

@ivan-kleshnin - I am using a similar dockerfile to you, are you using caches in your build at all?

FROM node:16.13-alpine AS deps
....
RUN apk add --update libc6-compat openssl openssl-dev
...
RUN npx prisma generate

when I change the platform with the following command, the build runs fine, prisma working as expected in the running image

docker buildx build --platform linux/amd64 -t t3-docker-remote .

However, running this natively just gives me the linking issue described elsewhere in this thread. Not perfect, but a workaround.

docker build --no-cache --progress plain  -t t3-docker .

...
===
#18 [builder 7/8] RUN npx prisma generate
#18 sha256:c7637aa50432c0c2d8ea90a90427e815ffa0054831571436cc5760b182addbd8
#18 0.712 Error: Unknown binaryTarget linux-arm64-openssl-undefined and no custom engine files were provided

@janpio
Copy link
Member

janpio commented Aug 20, 2022

Please open new issues with additional information if you still encounter this problem. Thanks.

@prisma prisma locked as resolved and limited conversation to collaborators Aug 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. topic: error handling
Projects
None yet
Development

No branches or pull requests