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

$/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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 32 (13 by maintainers)

Most upvoted comments

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.

What error exactly @cmwhited? Can you try with a prisma@dev and @prisma/client@dev (or version 4.0.0 which will be release tomorrow) please and post the full output you are getting? That would help us to make sure you ar egetting the same error indeed.

Updated to v4.0.0 and it still fails. I think it is actually an issue with pnpm. Testing now

update

after upgrading to v4, it is now throwing this more verbose error

#21 2.546 Error: Get Config: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
#21 2.546 Details: Unable to require(`/app/node_modules/.pnpm/prisma@4.0.0/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
#21 2.546  Error relocating /app/node_modules/.pnpm/prisma@4.0.0/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node: __res_init: symbol not found

update 2

Switching from pnpm to yarn does not solve the issue, throws error

#18 1.179 api:gen:types: Prisma schema loaded from prisma/schema.prisma
#18 1.419 api:gen:types: Error: Get Config: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
#18 1.421 api:gen:types: Details: Unable to require(`/app/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
#18 1.421 api:gen:types:  Error relocating /app/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node: __res_init: symbol not found
#18 1.421 api:gen:types: 
#18 1.421 api:gen:types: Prisma CLI Version : 4.0.0
#18 1.438 api:gen:types: error Command failed with exit code 1.

idk if it helps, but here are my versions

  • nodejs: v16.15.0
  • yarn: v1.22.17
  • pnpm: v7.3.0
  • mac osx: v12.4, m1 chip
  • docker: version 20.10.16, build aa7e414

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

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

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.

Your error is different @cmwhited, which is now nicely visible with the new error message. Can you copy your last message into a new issue please? Thanks. Happy to investigate what is going on there.

Follow up question 1 (please reply in new issue): Does /app/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node exist?

https://github.com/prisma/prisma/issues/14043