question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!

See original GitHub issue

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

  1. run next dev and prisma generate will cause the issue

Environment & setup

  • OS: Ubuntu (WSL2)
  • Database: MySQL (Planetscale)
  • Node.js version: 16.15

Prisma Version

4.0.0

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:11
  • Comments:33 (6 by maintainers)

github_iconTop GitHub Comments

43reactions
zackdotcomputercommented, Dec 13, 2022

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 install command:

RUN apk add --update --no-cache openssl1.1-compat

30reactions
smithbm2316commented, Jul 10, 2022

If 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 version and if you get back OpenSSL 1.1.1p 21 Jun 2022 or something with 1.x in it, that may be your issue. By making sure that /usr/bin had precedence in my $PATH over my Homebrew install, my system used the proper binaries installed by apt (openssl, libssl-dev, and libc6). 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Get config: Unable to establish a connection to query ...
I face the same error with npm and yarn. I run all Prisma command. I start with a fresh supabase database. prisma migrate...
Read more >
Joby Harding (@joby_h) / Twitter
Unable to establish a connection to query-engine-node-api library. It seems there is a problem with... I have a new laptop with ubuntu 22.04...
Read more >
openssl - Rust - Docs.rs
Both OpenSSL libraries and headers are required to build this crate. There are multiple options available to locate OpenSSL. Vendored. If the vendored...
Read more >
PostgreSQL connection errors in release_command - Fly.io
I'm getting a P1017 “Server has closed the connection” error. ... posts on here with similar issues, but it doesn't seem like there...
Read more >
Fly.ioでのデプロイの際のエラーについて - Shopify Community
Error : Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found