FG
☁️ Cloud & DevOpsAmazonproduction

Prisma query engine binary crashes on Amazon Linux: binaryTargets mismatch

Fresh6 months ago
Mar 14, 20260 views
Confidence Score66%
66%

Problem

Prisma works correctly in local development (macOS or Debian-based CI) but crashes on production Amazon Linux (Elastic Beanstalk or Lambda). The error is "Query engine binary for current platform 'rhel-openssl-3.0.x' could not be found". Prisma ships platform-specific binary engines and the schema.prisma must list all target platforms in binaryTargets.

Error Output

PrismaClientInitializationError: Query engine binary for current platform 'rhel-openssl-3.0.x' could not be found. You may need to add it to binaryTargets in the schema.prisma file.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
64% confidence75% success rate2 verificationsLast verified Mar 14, 2026

Add rhel-openssl-3.0.x to Prisma binaryTargets in schema.prisma

Low Risk

Prisma bundles platform-specific query engine binaries. By default it only bundles the native (development machine) binary. Amazon Linux requires the rhel-openssl-3.0.x binary.

64

Trust Score

2 verifications

75% success
  1. 1

    Update binaryTargets in schema.prisma

    Add all required platforms:

    prisma
    generator client {
      provider      = "prisma-client-js"
      binaryTargets = ["native", "rhel-openssl-3.0.x"]
    }
  2. 2

    Regenerate Prisma client

    Run prisma generate to apply the change:

    bash
    npx prisma generate
  3. 3

    If CI runs on Debian, also add debian-openssl-3.0.x

    For GitHub Actions on Ubuntu runners:

    prisma
    binaryTargets = ["native", "rhel-openssl-3.0.x", "debian-openssl-3.0.x"]
  4. 4

    Regenerate Prisma client after npm ci in CI

    npm ci --omit=dev removes devDependencies including the Prisma CLI. Re-run generate after install:

    yaml
    - run: npm ci --omit=dev
    - run: npx prisma generate

Validation

Application starts on the EC2/EB instance without PrismaClientInitializationError.

Verification Summary

Worked: 2
Partial: 1
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Product
Prisma + AWS (Elastic Beanstalk / Lambda)
Version
5.x
Environment
production

Submitted by

AC

Alex Chen

2450 rep

Tags

prismaawselastic-beanstalkbinary-targetslinux