FG
๐Ÿ’ป Software๐Ÿ—„๏ธ DatabasesVercel

Prisma generate randomly fails on Ubuntu due to missing internal .so `libquery_engine-debian-openssl-1.1.x.so.node`

Fresh3 days ago
Mar 14, 20260 views
Confidence Score73%
73%

Problem

Bug description Here is my package.json in the root of my repo: [code block] I have two database packages with `prisma-generate` scripts that look like so: [code block] In my GitHub actions, when I run `pnpm install`, I randomly (and only sometimes) get the following error: [code block] How to reproduce See above. Can't consistently reproduce Expected behavior No errors Prisma information See above Environment & setup - OS: `runs-on: ubuntu-latest` from my GH action - Database: PostgreSQL - Node.js version: `18.12.1` Prisma Version [code block]

Error Output

Error: ENOENT: no such file or directory, stat '/home/runner/work/Ecominate/Ecominate/node_modules/.pnpm/prisma@4.13.0/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node'

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix โ€“ Awaiting Verification

Ensure Consistent Prisma Binary Generation on Ubuntu

Medium Risk

The error occurs due to the Prisma CLI not generating the required native binaries consistently during the installation process, particularly on CI environments like GitHub Actions. This can happen if the installation process is interrupted or if the environment does not have the necessary build tools or dependencies installed.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Install Required Build Tools

    Ensure that all necessary build tools and libraries are installed in the GitHub Actions environment to support the generation of Prisma binaries.

    bash
    sudo apt-get update && sudo apt-get install -y build-essential libssl-dev
  2. 2

    Force Prisma Binary Generation

    Modify the GitHub Actions workflow to explicitly run the Prisma generate command after installation to ensure that the binaries are generated correctly.

    bash
    pnpm prisma generate
  3. 3

    Cache Node Modules

    Implement caching for the node_modules directory in your GitHub Actions to prevent unnecessary installations and ensure that the binaries persist across runs.

    yaml
    steps:
      - name: Cache node modules
        uses: actions/cache@v2
        with:
          path: node_modules
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
  4. 4

    Check for Prisma Version Compatibility

    Ensure that the Prisma version specified in your package.json is compatible with your Node.js version and the database you are using. Update Prisma if necessary.

    bash
    pnpm update prisma

Validation

Run the GitHub Actions workflow again and ensure that the installation completes without errors. Verify that the Prisma binaries are generated correctly by checking for the presence of 'libquery_engine-debian-openssl-1.1.x.so.node' in the node_modules directory.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

prismaormpostgresqlbug/2-confirmedkind/bugtopic:-prisma-generatetopic:-linux