prisma: `libssl.so.1.1`: cannot open shared object file

Bug 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

  1. Do a fresh install of Ubuntu 22.04.1
  2. Create a project using Prisma
  3. 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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Hey @mael-queau, could you please share a reproduction of your Fedora environment (e.g., a Dockerfile) where Prisma needs an explicitly installed version of openssl to run? I suspect there is no libssl installed in your system, which is required by the Prisma Client. Thanks.

Hi, I just got the notification from GitHub (I apologize for the three-month delay) but sadly, I can’t remember what situation the issue happened in. I have been using Fedora 37 since its release, and have been lately using my company’s MacBook Pro without issue, so I’m uncertain I’d be able to create a reproduction.

If you really do need it, I could take some time to try and find it again though

Either way, thank you very much for the attention you paid my issue!

I found this setup useful on Ubuntu 22.04 on WSL 2.

$ mkdir $HOME/opt && cd $HOME/opt
$ wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
$ tar -zxvf openssl-1.1.1o.tar.gz
$ cd openssl-1.1.1o
$ ./config && make && make test # some tests will fail, it's not an issue
$ mkdir $HOME/opt/lib
$ mv $HOME/opt/openssl-1.1.1o/libcrypto.so.1.1 $HOME/opt/lib/
$ mv $HOME/opt/openssl-1.1.1o/libssl.so.1.1 $HOME/opt/lib/

And then

export LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH

When you need to use it.

Thank you for the response and for the initial report @mael-queau! The problem should be fixed as of Prisma 4.9.0 or later, so I’m going to go ahead and close this issue. Please open a new issue if you still run into any problems.

Hey @jakeklassen, for Ubuntu, no such setup should be needed as of prisma@4.8.0. Here’s a Dockerfile from our docker test suite, no explicitly installed openssl-1.1.x is needed on Ubuntu 22.04, as Prisma is able to detect the openssl-3.0.x version installed in the system by default.

Well, the switch to Fedora 36 has been made, and the issue is still here, exactly the same as before…

Of course, here it is: image

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.