Incorrect platform for CloudLinux OS
See original GitHub issueBug description
On a CloudLinux OS, in my understanding, prisma doesn’t use/download the correct engine. Hence, native target doesn’t match the systyem and we can’t generate client, nor launch prisma -v
Expected engine should be rhel-openssl-1.0.x, but debian-openssl-1.1.x is used.
I can tweak the files (rhel files named as debian ones) so that prisma -v works
(which confirms that rhel engine should be used)
But can’t find a way to make generate work, even with binaryTargets = ["rhel-openssl-1.0.x"]
in prisma.schema
(may be linked to the implicite native ? https://github.com/prisma/prisma/issues/12691)
Error logs :
prisma -v (see below for the working output)
Environment variables loaded from .env
Error: Command failed with exit code 127: /home/wufwjymd/nodevenv/drimex/14/lib/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x --version
/home/wufwjymd/nodevenv/drimex/14/lib/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
prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Unable to require(`/home/wufwjymd/nodevenv/drimex/14/lib/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node`)
/lib64/libc.so.6: version `GLIBC_2.18' not found (required by /home/wufwjymd/nodevenv/drimex/14/lib/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node)
How to reproduce
Can be reproduced every time in a Node.js environnement provided by Planethoster
Environment & setup
- OS: CloudLinux , kernel version leads to CloudLinux 7 (that’s why I tried the rhel engine)
- Node.js version: v14.17.3
Prisma Version
With files tweaked
Environment variables loaded from .env
prisma : 3.14.0
@prisma/client : 3.14.0
Current platform : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at ../nodevenv/drimex/14/lib/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine : migration-engine-cli 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at ../nodevenv/drimex/14/lib/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at ../nodevenv/drimex/14/lib/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at ../nodevenv/drimex/14/lib/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : 2b0c12756921c891fec4f68d9444e18c7d5d4a6a
Studio : 0.460.0
Issue Analytics
- State:
- Created a year ago
- Comments:10 (3 by maintainers)
Top GitHub Comments
If you only need the Prisma client running on PlanetHoster, I ended up with a more convenient way by building the app (and most importantly generating Prisma client) outside of PlanetHoster with a matching node version, and running the app on it afterwards.
For that, before build you can add
binaryTargets = ["rhel-openssl-1.0.x"]
ingenerator client { }
of schema.prisma, and after the app is built (that means afterprisma generate
), you would have to rename innode_modules/.prisma/client
folderlibquery_engine-rhel-openssl-1.0.x.so.node
tolibquery_engine-debian-openssl-1.1.x.so.node
– The other workaround involved modifying builded/packed js files, that’s not clean, but in the files I mentioned in the previous message, the idea is to make the
getPlatform()
function directly returningrhel-openssl-1.0.x
. Download script isn’t present anymore, so same modification innodes_modules/@prisma/engines/dist/postinstall.js
, After that innodes_modules/@prisma/engines
folder, you would have to runnode scripts/postinstall.js
to download the appropriate engines.The way I circumvent that is not sustainable, a bit hacky, and might not suit every case. So I prefer not to share an exact process, it’s better to wait for an override platform detection feature.
Anyway, without the details, it involves editing prisma production files
nodes_modules\prisma\build\index.js
andnodes_modules@prisma\client\runtime\index.js
and download the appropriate engine innodes_modules\@prisma\engines
with the download script inside and the corresponding environment variable.