Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeJS + Docker | Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation! #16182

Closed
noah-haub opened this issue Nov 8, 2022 · 5 comments
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: docker topic: openssl
Milestone

Comments

@noah-haub
Copy link

Bug description

I want to use docker compose with NodeJS and Prisma, but for some reason keep getting this error when running it on my Digital Ocean Droplet.

npx prisma generate

Prisma schema loaded from prisma/schema.prisma
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(/app/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: getDmmf]

Prisma CLI Version : 4.6.0docker-compose

How to reproduce

Create a simple NodeJS + Express application and use Prisma in it.

Expected behavior

I excpected prisma generate to work. It works when developing locally, but not when I deploy it to my Digital Ocean Droplet.

Prisma information

generator client {
    provider        = "prisma-client-js"
    previewFeatures = ["extendedWhereUnique"]
    binaryTargets   = ["native", "debian-openssl-1.1.x"]
}

datasource db {
    provider = "mongodb"
    url      = env("MONGODB_URI")
}

Environment & setup

  • OS: Ubuntu 20.04.2 LTS
  • Database: MongoDB
  • Node.js version: v16.15.1

Prisma Version

4.6.0
@noah-haub noah-haub added the kind/bug A reported bug. label Nov 8, 2022
@SevInf SevInf added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. team/client Issue for team Client. topic: openssl labels Nov 9, 2022
@noah-haub
Copy link
Author

Everything seems to work fine now.

All I changed was the node image I was pulling in my Dockerfile.

I was using this base image:
node:16-slim
Now it's working and I'm using this base image:
node:18-slim

Can't believe it was just the wrong version hahah.

@jkomyno
Copy link
Contributor

jkomyno commented Jan 4, 2023

Hi @noah-haub, I'm closing this issue as you've found a working solution: using node:18-slim rather than node:16-slim.
Let me give you (and future readers) a bit more context about this.

The node:16-slim Docker image is an alias of node:16-buster-slim, which uses Linux Debian 10.x (Buster) under the hood. This image of Debian Buster doesn't have any version of openssl installed, which is a fundamental system library Prisma (and, in particular, its query engine used by @prisma/client) depends on. If you wanted to use node:16-slim and Prisma together, you'd need to manually install openssl-1.1.x, as shown here:

RUN apt-get update -y \
  && apt-get install -y openssl

node:18-slim, on the other hand, is an alias of node:16-bullseye-slim, which uses Linux Debian 11.x (Bullseye) and has openssl-1.1.x already installed.

@pimmesz
Copy link

pimmesz commented Jan 14, 2023

Doesn't work for me. Still getting Error: Not Found https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/linux-arm-openssl-1.1.x/libquery_engine.so.node.gz

with FROM node:18-slim

@jkomyno
Copy link
Contributor

jkomyno commented Jan 15, 2023

Hi @pimmesz, could you please open a new issue using this issue template? It looks like you're on an arm32 linux machine, which should be supported by Prisma.

@pimmesz
Copy link

pimmesz commented Jan 16, 2023

Thanks for your reply. I have an open issue at the moment. I'm running Linux 5.15.84-v8+ aarch64

@janpio janpio added this to the 4.9.0 milestone Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: docker topic: openssl
Projects
None yet
Development

No branches or pull requests

6 participants