prisma: `__res_init: symbol not found` when running Prisma
What error exactly @cmwhited? Can you try with a
prisma@devand@prisma/client@dev(or version 4.0.0 which will be release tomorrow) please and post the full output you are getting? That would help us to make sure you ar egetting the same error indeed.
Updated to v4.0.0 and it still fails. I think it is actually an issue with pnpm. Testing now
update
after upgrading to v4, it is now throwing this more verbose error
#21 2.546 Error: Get Config: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
#21 2.546 Details: Unable to require(`/app/node_modules/.pnpm/prisma@4.0.0/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
#21 2.546 Error relocating /app/node_modules/.pnpm/prisma@4.0.0/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node: __res_init: symbol not found
update 2
Switching from pnpm to yarn does not solve the issue, throws error
#18 1.179 api:gen:types: Prisma schema loaded from prisma/schema.prisma
#18 1.419 api:gen:types: Error: Get Config: Unable to establish a connection to query-engine-node-api library. It seems there is a problem with your OpenSSL installation!
#18 1.421 api:gen:types: Details: Unable to require(`/app/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
#18 1.421 api:gen:types: Error relocating /app/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node: __res_init: symbol not found
#18 1.421 api:gen:types:
#18 1.421 api:gen:types: Prisma CLI Version : 4.0.0
#18 1.438 api:gen:types: error Command failed with exit code 1.
idk if it helps, but here are my versions
- nodejs: v16.15.0
- yarn: v1.22.17
- pnpm: v7.3.0
- mac osx: v12.4, m1 chip
- docker: version 20.10.16, build aa7e414
_Originally posted by @cmwhited in https://github.com/prisma/prisma/issues/13717#issuecomment-1169255951_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 27 (5 by maintainers)
Commits related to this issue
- chore: reproduced issue https://github.com/prisma/prisma/issues/14043 — committed to jkomyno/reproduce-issue-14043 by jkomyno 2 years ago
- chore: reproduced issue https://github.com/prisma/prisma/issues/14043 — committed to jkomyno/reproduce-issue-14043 by jkomyno 2 years ago
- fix: use node alpine 16.18.0 to fix prisma build error https://github.com/prisma/prisma/issues/14043 — committed to OpenWebhook/webhook-store by Samox a year ago
- Docker deploy/fix prisma error (#95) * refactor: remove types package from dependencies * fix: use node alpine 16.18.0 to fix prisma build error https://github.com/prisma/prisma/issues/14043 — committed to OpenWebhook/webhook-store by Samox a year ago
- feature: upgrade node version to 18 https://github.com/prisma/prisma/issues/14043#issuecomment-1348518342 — committed to OpenWebhook/webhook-store by Samox a year ago
- Upgrade versions (#97) * feature: upgrade node version to 18 https://github.com/prisma/prisma/issues/14043#issuecomment-1348518342 * docs: add a documentation for docker * chore: upgrade prism... — committed to OpenWebhook/webhook-store by Samox a year ago
Thanks @edlundin - that unblocked me. Adding
RUN apk add --update --no-cache openssl1.1-compatto my dockerfile has fixed builds without needing to resort to the downgrade/crossgrade/emulation solutions on other threads.I had the same issue with the docker image node:19-alpine, but using node:19-alpine3.16 fixed it.
Could it be an issue with alpine 3.17? Quoting https://alpinelinux.org/posts/Alpine-3.17.0-released.html, the default OpenSSL version, starting from 3.17, is 3.0. To use OpenSSL 1.1, installing the package openssl1.1-compat seems necessary.
@senorscan Interesting, it works for me for 16.12-alpine, but for 18 it won’t work. It seems there really is some regression. Maybe you can try 16.12.
Yeah somebody should definitely put up somewhere that installing Prisma on alpine crashes with these most bizarre error messages. Switching to slim and adding
RUN apt-get update && apt-get -y install opensslfixed this for me.Hey, Alberto from Prisma here.
For people facing this issue on Linux Alpine (e.g., when using the
node:alpine,node:lts-alpineDocker images), please refer to this solution: https://github.com/prisma/prisma/issues/16553#issuecomment-1353302617@janpio switching docker to the
16.15-slimimage does work. So it is anxx-alpinedocker image issueweird, it was working fine for months, and just from this morning it has been failing in my Gitlab CI, building manually from local is fine. No change from my Dockerfile at all.
Adding this before
npm installfixed the issue:Update: build success with the above change, but at runtime , it throw error:
I specified the node version as “node:alpine” in my Dockerfile. I switched it to 16.2 and now it works fine.
@valentinpezon-primo In my case I’m on
node:fermium-alpinestill but yes to the rest. Just needed to be sure to add theapkcommand before thenpm installcommand because of the prisma post-install hook.getting this issue in my bitbucket pipelines too
@valentinpezon-primo yes, I just tried it with node:18.12-alpine, it seems to work for any version. Perfect, thanks.
Same issue on my side using prisma 4.x.x, any update?
I’m using
node:18-alpine, upgraded from prisma3.14to4.3.1and now I experience the same issue…PS: I’m not running this via compose - but deploy image to AWS ECS (fargate) and it doesn’t want to work there
fixed as well by switching to
FROM node:16.2.0-alpine AS depsWhen I Add this line I can build the Docker-file but I get the error:
it is related to OpenSSL as @edlundin already said. Prisma only supports 1.X instead of 3.0 which is now default in the alpine builds >3.16
see also this issue https://github.com/prisma/prisma/issues/16553
It worked! Thank you very much.