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.

Libquery Engine not working on AWS RHEL and CentOS 7 EC2 Images

See original GitHub issue

Bug description

Lately, whenever I try connecting to my MySQL database on my CentOS 7 and RHEL 7.0 EC2 images, the connection attempt fails and gives me the following error:

prisma:client:libraryEngine Searching for Query Engine Library in /snapshot/repo/node_modules/.prisma/client +55ms
  prisma:client:libraryEngine loadEngine using /snapshot/repo/node_modules/.prisma/client/libquery_engine-rhel-openssl-1.0.x.so.node +0ms
 ✖ Validate database credentials

An unexpected error occurred:

  Error: Unable to load Node-API Library from /snapshot/repo/node_modules/.prisma/client/libquery_engine-rhel-openssl-1.0.x.so.node, Library may be corrupt
    at Object.loadEngine (/snapshot/repo/node_modules/@prisma/client/runtime/index.js:41375:21)
    at async Object.instantiateLibrary (/snapshot/repo/node_modules/@prisma/client/runtime/index.js:41330:5)
    at async Object.start (/snapshot/repo/node_modules/@prisma/client/runtime/index.js:41480:5)
    at async we.connect (/snapshot/repo/packages/on-prem/dist/js/src/main.js)
    at async Object.nt [as task] (/snapshot/repo/packages/on-prem/dist/js/src/main.js)
    at async ye.runTask (/snapshot/repo/packages/on-prem/dist/js/src/main.js)
    at async ye.loop (/snapshot/repo/packages/on-prem/dist/js/src/main.js)
    at async ye.runChildren (/snapshot/repo/packages/on-prem/dist/js/src/main.js)
    at async ye.loop (/snapshot/repo/packages/on-prem/dist/js/src/main.js)
    at async ye.run (/snapshot/repo/packages/on-prem/dist/js/src/main.js)

This has been working on the same above environments since April 12, 2022 and earlier. I’ve tried using one of our bundles from earlier successful releases and it hasn’t worked, although, I was able to get it to connect and run on a non-AWS EC2 image with a local RHEL 7.9 box. Edit: Was able to get it to work with a previous version of my installer. There must’ve been some kind of issue when I tried uploading the installer to test the production releases.

How to reproduce

  1. Create a CentOS 7 or RHEL 7.0 AWS EC2 image with a MySQL 8.0 database.
  2. Attempt to connect to the database with libquery_engine-rhel-openssl-1.0.x.so.node.
  3. See error

Expected behavior

Prisma should be able to connect to the database and make successful queries.

Prisma information

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["rhel-openssl-1.0.x", "native"]
  previewFeatures = ["interactiveTransactions"]
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

model Customer {
  id        Int              @id @default(autoincrement())
  name      String           @db.VarChar(255)
  clientId  String           @unique @map("client_id") @db.VarChar(255)
  createdAt DateTime         @default(now()) @map("created_at") @db.DateTime(6)
  updatedAt DateTime         @default(now()) @map("updated_at") @db.DateTime(6)
  projects  Project[]
  servers   ServerLocation[]

  @@map("customer")
}

...

Environment & setup

  • OS: CentOS 7, RHEL 7.0
  • Database: MySQL 8.0
  • Node.js version: 16.14.2

Prisma Version

3.13.0

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bakerukcommented, Sep 17, 2022

+1

Although you have got around your problem, I am right in saying that this is still an outstanding Prisma issue which needs to be fixed by the Prisma team/community?

1reaction
okrycommented, Apr 28, 2022

Yeah so I looked into it and it seems there was something non-prisma related that was causing the corrupt file problem. To solve that, I simply updated my yarn.lock to what was on our release branch. But, when I updated it and used prisma@3.13.0 I was able to get it to work in CentOS 7, but not RHEL 7 where I was still having the corrupt file error. Once I reverted back to prisma@3.10.0 it was able to run on all of our environments again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable the EPEL repository for EC2 instances ... - Amazon AWS
I have an Amazon Elastic Compute Cloud (Amazon EC2) instance running CentOS, Red Hat Enterprise Linux (RHEL), or Amazon turn on access to ......
Read more >
Install a web server on your EC2 instance - AWS Documentation
This command installs multiple software packages and related dependencies at the same time. sudo amazon-linux-extras install php8.0 mariadb10.
Read more >
Use EC2Rescue for Linux to resolve OS-level issues on ...
I can't connect to my Amazon Elastic Compute Cloud (Amazon EC2) Linux instance or I'm experiencing boot issues. To correct these problems, ...
Read more >
Install Software From the Extras Library on an Amazon Linux 2 ...
How do I install a software package (known as a topic) from the amazon-linux-extras repository on an Amazon Elastic Compute Cloud (Amazon EC2) ......
Read more >
Operating systems and programming languages supported by ...
For container images in Amazon ECR, Amazon Inspector can scan for both ... Amazon Linux 2022 (AL2022), AL2022, ALAS ... CentOS Linux (CentOS),...
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