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.

Incorrect platform for CloudLinux OS

See original GitHub issue

Bug 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:open
  • Created a year ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Maxime-Jcommented, Sep 13, 2022

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"] in generator client { } of schema.prisma, and after the app is built (that means after prisma generate), you would have to rename in node_modules/.prisma/client folder libquery_engine-rhel-openssl-1.0.x.so.node to libquery_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 returning rhel-openssl-1.0.x. Download script isn’t present anymore, so same modification in nodes_modules/@prisma/engines/dist/postinstall.js, After that in nodes_modules/@prisma/engines folder, you would have to run node scripts/postinstall.js to download the appropriate engines.

1reaction
Maxime-Jcommented, Jul 10, 2022

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 and nodes_modules@prisma\client\runtime\index.js and download the appropriate engine in nodes_modules\@prisma\engines with the download script inside and the corresponding environment variable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with cloudlinux 8.5 update - Forums
Hi, I have issue with cloudlinux update, I have below version ... fedora centos" VERSION_ID="8.5" PLATFORM_ID="platform:el8" and when try to update with dnf ......
Read more >
Can't update packages on CloudLinux OS 8
Cause. Incorrect cloudlinux-release package that contains the wrong configuration.
Read more >
Agent platforms - Workload Security - Trend Micro Cloud One
Agent Platform Agent Version Agent Version Agent Version Ag... 20 LTS 12 FR 12 LTS 11.3 Windows XP (32‑ and 64‑bit) (See Note 5) Windows 7...
Read more >
Troubleshoot Your Installation | cPanel & WHM Documentation
This problem was due to conflicts between ESET and cPanel & WHM in version 88 and earlier. Solution. ESET authors resolved these issues...
Read more >
Issues with CloudLinux - ISPmanager Documentation
Possible issues that can occur when converting into CloudLinux ... You can monitor the conversion process in the "Cluster nodes" module – select...
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