Get config: Unable to establish a connection to query-engine-node-api library
See original GitHub issueBug description
Hi,
I’m having an issue that has already been described in other (closed) issues, but there isn’t a solution anywhere for it.
Issue #13717 focuses on node being installed via snap
, but this isn’t the case, as you can see here:
$ whereis node
node: /home/mael/.local/share/fnm/node-versions/v18.9.1/installation/bin/node
$ whereis openssl
openssl: /usr/bin/openssl /home/linuxbrew/.linuxbrew/bin/openssl /usr/share/man/man1/openssl.1ssl.gz
Indeed, node isn’t installed through snap
but through fnm
, an dI have tested various means of installing it (nvm
for instance) to no avail.
This comment has the same issue as me, but sadly didn’t get an answer either.
So, here is my output trying to run prisma generate
(it is in the pnpm prepare
script, so automatically run by pnpm install
):
~/Documents/Projects/roboct0 > pnpm i
corepack Reusing pnpm@7.12.1 +0ms
Scope: all 2 workspace projects
Lockfile is up to date, resolution step is skipped
Already up to date
packages/api prepare$ prisma generate
│ 2022-09-24T14:15:16.813Z prisma:engines binaries to download libquery-engine, migration-engine, introspection-engine, prisma-fmt
│ 2022-09-24T14:15:17.144Z prisma:loadEnv project root found at /home/mael/Documents/Projects/roboct0/packages/api/package.json
│ 2022-09-24T14:15:17.158Z prisma:tryLoadEnv Environment variables loaded from /home/mael/Documents/Projects/roboct0/packages/api/.env
│ Environment variables loaded from .env
│ Prisma schema loaded from prisma/schema.prisma
│ 2022-09-24T14:15:17.361Z prisma:getConfig Using CLI Query Engine (Node-API Library) at: /home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/libquery_engi
│ 2022-09-24T14:15:17.362Z prisma:getConfig error of type "connection-error" in getConfigNodeAPI:
│ {
│ reason: 'Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!',
│ error: Error: Unable to require(`/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/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
│ at load (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89300:11)
│ at error2 (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89366:13)
│ at tryCatch (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:88832:19)
│ at loadNodeAPILibrary (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89365:5)
│ at getConfigNodeAPI (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89464:5)
│ at async getConfig (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89445:16)
│ at async getGenerators (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:91517:18)
│ at async _Generate.parse (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:96766:20)
│ at async main (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:98499:18)
│ }
│ Error: Error: 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/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/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
│ [Context: getConfig]
│ Prisma CLI Version : 4.3.1
│ at /home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89533:12
│ at O.run (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:86444:12)
│ at O.otherwise (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:86421:115)
│ at getConfigNodeAPI (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89531:6)
│ at async getConfig (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89445:16)
│ at async getGenerators (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:91517:18)
│ at async _Generate.parse (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:96766:20)
│ at async main (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:98499:18)
└─ Failed in 868ms
ELIFECYCLE Command failed with exit code 1.
I don’t know what to do, I only just switched from Windows where everything was working just fine to Ubuntu and I can’t seem to be able to use Prisma at all now. Of course, I didn’t copy and paste anything, I used git clone
to get my project in order to work on it on my newly installed Linux distro.
How to reproduce
- Do a fresh install of Ubuntu 22.04.1
- Create a project using Prisma
- Try to generate a schema
Expected behavior
I expected it to generate the prisma client without a hitch, as it always had up until that point.
Prisma information
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
Environment & setup
- OS: Ubuntu 22.04.1 LTS
- Database: PostgreSQL
- Node.js version: v18.9.1
Prisma Version
Error: Unable to require(`/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/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
at load (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:89300:11)
at getEngineVersion (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:90023:16)
Error: Command failed with exit code 127: /home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x --version
/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
at makeError (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:3641:18)
at handlePromise (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:4409:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getEngineVersion (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:90026:20) {
shortMessage: 'Command failed with exit code 127: /home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x --version',
command: '/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x --version',
escapedCommand: '"/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x" --version',
exitCode: 127,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: '/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
Error: Command failed with exit code 127: /home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x --version
/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
at makeError (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:3641:18)
at handlePromise (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:4409:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getEngineVersion (/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/prisma@4.3.1/node_modules/prisma/build/index.js:90026:20) {
shortMessage: 'Command failed with exit code 127: /home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x --version',
command: '/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x --version',
escapedCommand: '"/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x" --version',
exitCode: 127,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: '/home/mael/Documents/Projects/roboct0/node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
prisma : 4.3.1
@prisma/client : 4.3.1
Current platform : debian-openssl-1.1.x
Query Engine (Node-API) : E_CANNOT_RESOLVE_VERSION (at ../../node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine : E_CANNOT_RESOLVE_VERSION (at ../../node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : E_CANNOT_RESOLVE_VERSION (at ../../node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt c875e43600dfe042452e0b868f7a48b817b9640b (at ../../node_modules/.pnpm/@prisma+engines@4.3.1/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Format Wasm : @prisma/prisma-fmt-wasm 4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b
Default Engines Hash : c875e43600dfe042452e0b868f7a48b817b9640b
Studio : 0.473.0
Issue Analytics
- State:
- Created a year ago
- Comments:12 (3 by maintainers)
Top GitHub Comments
I found this setup useful on Ubuntu 22.04 on WSL 2.
And then
When you need to use it.
Of course, here it is:
As you can see, the exact same thing happens with npm and a freshly initialized project. I have a done a complete reinstallation of Ubuntu since opening this issue, so I don’t believe that it could be linked to any configuration of conflicting software, for example.