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.

Prisma Client: Query Engine `engineType=binary` incompatible with Node.js v17?

See original GitHub issue

Note: Node.js v17 is an intermediary release and won’t become an LTS version and should not be used for production workloads.

I created a PR in our e2e tests suite here https://github.com/prisma/e2e-tests/pull/2137 to add a minimal test for v17 which succeeds on engineType “library” but fails on “binary” with https://github.com/prisma/e2e-tests/runs/3973259270?check_suite_focus=true#step:6:375

$ ts-node ./script.ts
PrismaClientKnownRequestError: 
Invalid `client.user.deleteMany()` invocation in
/home/runner/work/e2e-tests/e2e-tests/generic/basic/script.ts:7:21

   4 
   5 // A `main` function so that we can use async/await
   6 async function main() {
→  7   await client.user.deleteMany(
  connect ECONNREFUSED ::1:43951
    at cb (/home/runner/work/e2e-tests/e2e-tests/generic/basic/node_modules/@prisma/client/runtime/index.js:38537:17)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 'ECONNREFUSED',
  clientVersion: '3.4.0-dev.10',
  meta: undefined
}

Rerunning the test results in the same error. We should reproduce locally and see what’s happening here, looks like something about IPv6 maybe? ECONNREFUSED ::1:43951

Node.js v17 changelog here (didn’t find anything related) https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V17.md

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pantharshit00commented, Nov 11, 2021

I am unable to reproduce this with Node v17. I think it is just a random flaky test in e2e. Here is my successful run with Node 17 and binary engine:

harshit@drigger:~/issue_9903$ node -v
v17.1.0
harshit@drigger:~/issue_9903$ npm -v
8.1.2
harshit@drigger:~/issue_9903$ npx prisma -v

  prisma:loadEnv project root found at /home/harshit/issue_9903/package.json +0ms
  prisma:tryLoadEnv Environment variables not found at null +0ms
  prisma:tryLoadEnv Environment variables loaded from ./prisma/.env +0ms
Environment variables loaded from prisma/.env
  prisma:engines binaries to download query-engine, migration-engine, introspection-engine, prisma-fmt +0ms
  prisma:getConfig Using CLI Query Engine (Binary) at: /home/harshit/issue_9903/node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x +0ms
prisma                : 3.5.0-dev.29
@prisma/client        : 3.5.0-dev.29
Current platform      : debian-openssl-1.1.x
Query Engine (Binary) : query-engine af993bb6d5c28f94e4ab70f68ff69364b628af97 (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine      : migration-engine-cli af993bb6d5c28f94e4ab70f68ff69364b628af97 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine  : introspection-core af993bb6d5c28f94e4ab70f68ff69364b628af97 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary         : prisma-fmt af993bb6d5c28f94e4ab70f68ff69364b628af97 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash  : af993bb6d5c28f94e4ab70f68ff69364b628af97
Studio                : 0.439.0
  prisma:getConfig Using CLI Query Engine (Binary) at: /home/harshit/issue_9903/node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x +22ms
harshit@drigger:~/issue_9903$
harshit@drigger:~/issue_9903$ yarn start
yarn run v1.22.15
$ ts-node main.ts
  prisma:tryLoadEnv Environment variables not found at null +0ms
  prisma:tryLoadEnv Environment variables loaded from /home/harshit/issue_9903/prisma/.env +1ms
  prisma:tryLoadEnv Environment variables not found at null +1ms
  prisma:tryLoadEnv Environment variables loaded from /home/harshit/issue_9903/prisma/.env +0ms
[dotenv][DEBUG] "DATABASE_URL" is already defined in `process.env` and will not be overwritten
  prisma:client clientVersion: 3.5.0-dev.29 +0ms
  prisma:client Prisma Client call: +38ms
  prisma:client prisma.user.findMany(undefined) +1ms
  prisma:client Generated request: +0ms
  prisma:client query {
  prisma:client   findManyUser {
  prisma:client     id
  prisma:client     email
  prisma:client     name
  prisma:client   }
  prisma:client }
  prisma:client  +0ms
  prisma:engine { cwd: '/home/harshit/issue_9903/prisma' } +0ms
  prisma:engine Search for Query Engine in /home/harshit/issue_9903/node_modules/.prisma/client +5ms
  prisma:engine Search for Query Engine in /home/harshit/issue_9903/node_modules/.prisma/client +0ms
  plusX Execution permissions of /home/harshit/issue_9903/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x are fine +0ms
  plusX Execution permissions of /home/harshit/issue_9903/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x are fine +8ms
  prisma:engine { flags: [ '--enable-raw-queries', '--port', '41299' ] } +10ms
  prisma:engine stdout Starting a sqlite pool with 25 connections. +11ms
  prisma:engine stdout Started http server on http://127.0.0.1:41299 +3ms
  prisma:engine Search for Query Engine in /home/harshit/issue_9903/node_modules/.prisma/client +1ms
  plusX Execution permissions of /home/harshit/issue_9903/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x are fine +21ms
[]
  prisma:engine Stopping Prisma engine4 +12ms
  prisma:engine Waiting for start promise +0ms
  prisma:engine Done waiting for start promise +0ms
  prisma:engine Client Version: 3.5.0-dev.29 +3ms
  prisma:engine Engine Version: query-engine af993bb6d5c28f94e4ab70f68ff69364b628af97 +0ms
  prisma:engine Active provider: sqlite +0ms
Done in 1.11s.
harshit@drigger:~/issue_9903$
1reaction
janpiocommented, Nov 10, 2021

Prisma 2.x users are hitting this in the wild, and as the error message contains ECONNREFUSED mistake it for Prisma being unable to connect to the database: https://github.com/prisma/prisma/issues/10095

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query engine (Concepts) - Prisma
Prisma's query engine manages the communication with the database when using Prisma Client. Learn how it works on this page.
Read more >
Prisma 3.5.0 Release - GitClear
Prisma Client : Query Engine engineType=binary incompatible with Node.js v17? CI: Test on Node.js Active LTS v16 · After upgrading from 3.2.1 to ......
Read more >
Prisma ECONNREFUSED error after running prisma migrate ...
Prisma runs natively on the new M1 chips and there's nothing to configure, but I had the same issue, Prisma error: connect ECONNREFUSED ......
Read more >
@prisma/client - npm
Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data.
Read more >
prisma mongodb how to deal with schema update - You.com
Read Prisma Client provides a powerful API for reading data in MongoDB, ... Not found Current platform : darwin Query Engine (Node-API) :...
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