Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Client, Engine version incorrect when overriding binary with Prisma client constructor #696

Closed
divyenduz opened this issue May 18, 2020 · 3 comments · Fixed by prisma/prisma#2800
Assignees
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. tech/typescript Issue for tech TypeScript.
Milestone

Comments

@divyenduz
Copy link

Bug description

With export DEBUG=*, Prisma client logs Engine, Client version.

These versions are correct

  1. For the default binary
  2. When a binary is replace with QUERY_ENGINE_BINARY_PATH env var

These versions are incorrect (incorrectly pointing to the default binary)

  1. When binary is overridden with Prisma client's constructor
const prisma = new PrismaClient({
  __internal: {
    engine: {
      cwd: process.cwd(),
      binaryPath: path.join(process.cwd(), './binaries/query-engine'),
    },
  },
})

How to reproduce

Steps to reproduce the behavior:

  1. Compile a custom binary and use Prisma client constructor to override it.
  2. Use DEBUG=*
  3. Run the client and execute a query against it.

Expected behavior

The logged version should be of the binary being used.

@divyenduz divyenduz added bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. labels May 18, 2020
@Jolg42
Copy link
Member

Jolg42 commented May 18, 2020

So it appears that the engineVersion from the DEBUG output comes from the code generated client
Screen Shot 2020-05-18 at 16 30 37
(The client version in this screenshot is wrong and was already fixed)

@Jolg42 Jolg42 reopened this May 18, 2020
@Jolg42 Jolg42 added the tech/typescript Issue for tech TypeScript. label May 19, 2020
@Jolg42 Jolg42 added this to the Beta 6 milestone May 19, 2020
@Jolg42
Copy link
Member

Jolg42 commented May 19, 2020

The issue here is that the hash in the debug log is hardcoded so when the binary is different like when using an env var or with the constructor in the client it still outputs the hardcoded version.

@janpio janpio modified the milestones: Beta 6, Beta 7, Beta 8 May 26, 2020
@timsuchanek timsuchanek added the process/candidate Candidate for next Milestone. label Jun 10, 2020
@janpio janpio modified the milestones: Beta 10, 2.1.0 Jun 10, 2020
@janpio janpio removed the process/candidate Candidate for next Milestone. label Jun 11, 2020
@timsuchanek
Copy link
Contributor

Thanks a lot for reporting 🙏
This issue is fixed in the latest dev version of @prisma/cli.
You can try it out with npm i -g @prisma/cli@dev.

In case it’s not fixed for you - please let us know and we’ll reopen this issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. tech/typescript Issue for tech TypeScript.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants