prisma: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
Bug description
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/florian/zac-management/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
How to reproduce
- run
next devandprisma generatewill cause the issue
Environment & setup
- OS: Ubuntu (WSL2)
- Database: MySQL (Planetscale)
- Node.js version: 16.15
Prisma Version
4.0.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 16
- Comments: 38 (8 by maintainers)
Links to this issue
Commits related to this issue
- Fix dockerfile prisma/prisma#14073 — committed to ausspeedruns/ausspeedruns-keystone by EwanLyon a year ago
- chance docker base image https://github.com/prisma/prisma/issues/14073#issuecomment-1347789712 — committed to schoblaska/jotrecipes by schoblaska a year ago
- change docker base image https://github.com/prisma/prisma/issues/14073#issuecomment-1347789712 — committed to schoblaska/jotrecipes by schoblaska a year ago
- install openssl during build process to fix deploy (https://github.com/prisma/prisma/issues/14073#issuecomment-1348534199) — committed to codeday/labs-gql by oohwooh a year ago
For @victorkurauchi and others getting this issue on Alpine Linux (especially in Docker), this comment in another issue pointed out that the latest Alpine strips out legacy OpenSSL APIs. This caused this issue to start occurring for me recently. I was able to fix it without downgrading or cross-grading to bullseye or buster by adding this line to my dockerfile before the
npm installcommand:RUN apk add --update --no-cache openssl1.1-compatIf any of you still having this issue are using Homebrew on your machine, I found out through some very annoying debugging that apparently Homebrew had a higher precedence on my $PATH, and since I had installed other programs with it that depended on the OpenSSL 1.1 binary, my system was defaulting to that as the binary to use for OpenSSL instead of the default installed binary by Ubuntu (in my case Pop OS, a derivative of Ubuntu) in /usr/bin/openssl. Try running
openssl versionand if you get backOpenSSL 1.1.1p 21 Jun 2022or something with1.xin it, that may be your issue. By making sure that/usr/binhad precedence in my $PATH over my Homebrew install, my system used the proper binaries installed byapt(openssl,libssl-dev, andlibc6). Very niche issue, but hope this might help save someone else 1+ hours of digging 😅. All of this was total user error as the way I had added Homebrew to my $PATH was not what I intended, so I mistakenly had given it higher precedence over all my default /usr system folders.TLDR check and see if you have any other versions of OpenSSL installed on your system as a peer-dependency via something like Homebrew or another package manager, and make sure that version of OpenSSL is on version 3 or is not taking precedence over your system package manager’s version of OpenSSL
I had the same issue when running my nodejs+prisma app with Docker.
I was initially using
FROM node:16-alpineand after changing toFROM node:16-bullseye-slimit was working again.For node v18 the docker tag
node:18.12-alpine3.16also “fixes” the issue.Just curious, does anyone know what changed that could have caused this to be come an issue? Our docker image was using a pinned version (ie: 16.x.x-alpine) and it started having this issue sometime within the past few days.
edit: alpine pushed a new version out that bumped openssl up to 3.0, and the alpine version isn’t pinned in that package name.
Hey everyone, Alberto from Prisma here. For anyone getting this error on Linux Alpine (e.g., on
node:alpineornode:lts-alpine), please refer to https://github.com/prisma/prisma/issues/16553#issuecomment-1353302617Looks like something is happening with the library: openssl1.1-compat it is now switched to “dev” status: https://pkgs.alpinelinux.org/contents?file=libssl.so&path=&name=&branch=&arch=
Probably switching between images is an intermediate solution…
Adding line below helped to build the image:
Here is the full docker file:
I switched from
FROM node:16-alpinetoFROM node:16-alpine3.16and it works for me. It’s not a “fix”, but it will work for me now.If you have conda running on base, just go ahead and deactivate it
conda deactivatethen runnpx prisma studioNow I get it. Well I found out that openssl was the one for anaconda using the command
which opensslwhich returned the path of the anaconda version. With that I opened the .zshrc (nano .zshrc) and commented out everything I had of anaconda reference. To confirm I used the commandwhich opensslagain and now it pointed to the path of the most current versionSame type of error
Prisma CLI Version : 4.0.0 Ubuntu 22.04 LTS NodeJS 16.15.1 Database: MySQL (Planetscale)
I installed OpenSSL.Light and the problem is gone. Env: Node 16 LTS, Windows 11.
Even with OpenSSL installed on my machine (I have installed it through Brew), that’s what solved for me (Ubuntu 22.04): https://stackoverflow.com/a/72633324/1747282
Guys, I had this problem here and I found out that anaconda (which uses python) had the openssl version in 1.1.0, even though I updated the openssl version for my machine in 3.0.2 zsh just couldn’t find this version the anaconda. What I did was put the version of my machine as the main version of the system, with this change prisma started working again !!
Thank @janpio it was the problem.
NodeJS was sandbox by Ubuntu Software (Snap)
now everything is working