Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRISMA_ENGINES_MIRROR and BINARY_DOWNLOAD_VERSION env variables don't work when npm install #25433

Open
dengfuping opened this issue Oct 15, 2024 · 1 comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. topic: engine download

Comments

@dengfuping
Copy link

Bug description

How to reproduce

  • set env variables in .env:
PRISMA_ENGINES_MIRROR="https://oceanbase-prisma-builds.s3.ap-southeast-1.amazonaws.com"
BINARY_DOWNLOAD_VERSION="96fa66f2f130d66795d9f79dd431c678a9c7104e"
  • reinstall deps and view log rm -rf node_modules && DEBUG="prisma:*" npm i --foreground-scripts:
> [email protected] preinstall
> node scripts/preinstall-entry.js


> @prisma/[email protected] postinstall
> node scripts/postinstall.js

prisma:engines binaries to download libquery-engine, schema-engine +869ms
prisma:fetch-engine:download file xxx/node_modules/@prisma/engines/schema-engine-darwin does not exist and must be downloaded +7ms
prisma:fetch-engine:download file xxx/node_modules/@prisma/engines/libquery_engine-darwin.dylib.node does not exist and must be downloaded +0ms
prisma:fetch-engine:download https://binaries.prisma.sh/all_commits/06fc58a368dc7be9fbbbe894adf8d445d208c284/darwin/libquery_engine.dylib.node.gz will be downloaded to xxx/node_modules/@prisma/engines/libquery_engine-darwin.dylib.node +2ms
prisma:fetch-engine:download https://binaries.prisma.sh/all_commits/06fc58a368dc7be9fbbbe894adf8d445d208c284/darwin/schema-engine.gz will be downloaded to xxx/node_modules/@prisma/engines/schema-engine-darwin +0ms
prisma:fetch-engine:download Downloading https://binaries.prisma.sh/all_commits/06fc58a368dc7be9fbbbe894adf8d445d208c284/darwin/libquery_engine.dylib.node.gz to xxx/node_modules/@prisma/engines/libquery_engine-darwin.dylib.node ... +1ms
> Downloading Prisma engines for Node-API for darwin [                    ] 0%prisma:fetch-engine:download Downloading https://binaries.prisma.sh/all_commits/06fc58a368dc7be9fbbbe894adf8d445d208c284/darwin/schema-engine.gz to xxx/node_modules/@prisma/engines/schema-engine-darwin ... +90ms
prisma:loadEnv project root found at xxx/package.json +5826ms
prisma:getSchema prismaConfig {
  "packagePath": "xxx/package.json"
} +2ms
prisma:tryLoadEnv Environment variables loaded from xxx/.env +0ms
Environment variables loaded from .env
prisma:getSchema prismaConfig {
  "packagePath": "xxx/package.json"
} +5ms
prisma:getSchema Checking existence of xxx/schema.prisma +1ms
prisma:getSchema Reading schema from single file xxx/schema.prisma +0ms
prisma:getSchema Checking existence of xxx/prisma/schema.prisma +0ms
prisma:getSchema Reading schema from single file xxx/prisma/schema.prisma +0ms
prisma:getSchema Reading schema from multiple files xxx/prisma/schema +3ms
Prisma schema loaded from prisma/schema.prisma
prisma:getConfig Using getConfig Wasm +2ms
prisma:getConfig config data retrieved without errors in getConfig Wasm +19ms
prisma:getSchema Reading schema from single file xxx/prisma/schema.prisma +2ms
prisma:fetch-engine:download process.env.BINARY_DOWNLOAD_VERSION is set to "96fa66f2f130d66795d9f79dd431c678a9c7104e" +1ms
prisma:fetch-engine:download file xxx/node_modules/prisma/libquery_engine-darwin.dylib.node does not exist and must be downloaded +2ms
prisma:fetch-engine:download https://oceanbase-prisma-builds.s3.ap-southeast-1.amazonaws.com/all_commits/96fa66f2f130d66795d9f79dd431c678a9c7104e/darwin/libquery_engine.dylib.node.gz will be downloaded to xxx/node_modules/prisma/libquery_engine-darwin.dylib.node +3ms
prisma:fetch-engine:download Downloading https://oceanbase-prisma-builds.s3.ap-southeast-1.amazonaws.com/all_commits/96fa66f2f130d66795d9f79dd431c678a9c7104e/darwin/libquery_engine.dylib.node.gz to xxx/node_modules/prisma/libquery_engine-darwin.dylib.node ... +1ms
prisma:getConfig Using getConfig Wasm +34143ms
prisma:getConfig config data retrieved without errors in getConfig Wasm +1ms
prisma:getDMMF Using getDmmf Wasm +0ms
prisma:getDMMF Using given datamodel +1ms
prisma:getDMMF dmmf data retrieved without errors in getDmmf Wasm +32ms
prisma:generator prismaCLIDir xxx/node_modules/prisma +6ms
prisma:generator prismaClientDir xxx/node_modules/@prisma/client +0ms
prisma:generator baseDir xxx/prisma +0ms
prisma:generator typescriptPath xxx/node_modules/typescript +3ms
prisma:GeneratorProcess prisma:client:generator requiredEngine: libqueryEngine +26ms +138ms
prisma:mergeSchemas Using mergeSchemas Wasm +1ms
prisma:loadEnv project root found at xxx/node_modules/@prisma/client/package.json +3ms
prisma:getSchema prismaConfig {
  "packagePath": "xxx/package.json"
} +2ms
prisma:getGenerators neededVersions {
  "06fc58a368dc7be9fbbbe894adf8d445d208c284": {
    "engines": [
      "libqueryEngine"
    ],
    "binaryTargets": [
      {
        "fromEnvVar": null,
        "value": "darwin",
        "native": true
      }
    ]
  }
} +1ms
prisma:fetch-engine:download process.env.BINARY_DOWNLOAD_VERSION is set to "96fa66f2f130d66795d9f79dd431c678a9c7104e" +0ms
prisma:getGenerators {
  "generatorBinaryPaths": {
    "libqueryEngine": {
      "darwin": "xxx/node_modules/prisma/libquery_engine-darwin.dylib.node"
    }
  }
} +110ms
prisma:tryLoadEnv Environment variables not found at null +8ms
prisma:tryLoadEnv Environment variables loaded from xxx/.env +0ms
prisma:cli:bin Execution time for executing "await cli.parse(commandArray)": 39551.220044 ms +116ms

✔ Generated Prisma Client (v5.20.0) to ./node_modules/@prisma/client in 93ms

Start by importing your Prisma Client (See: http://pris.ly/d/importing-client)

Tip: Easily identify and fix slow SQL queries in your app. Optimize helps you enhance your visibility: https://pris.ly/--optimize

prisma:GeneratorProcess child exited with code null on signal SIGTERM +5ms
prisma:getSchema prismaConfig {
  "packagePath": "xxx/package.json"
} +1ms
prisma:getSchema Checking existence of xxx/schema.prisma +0ms
prisma:getSchema Reading schema from single file xxx/schema.prisma +0ms
prisma:getSchema prismaConfig {
  "packagePath": "xxx/package.json"
} +0ms
prisma:getSchema Checking existence of xxx/schema.prisma +0ms
prisma:getSchema Reading schema from single file xxx/schema.prisma +0ms
prisma:getSchema Checking existence of xxx/prisma/schema.prisma +0ms
prisma:getSchema Reading schema from single file xxx/prisma/schema.prisma +0ms
prisma:getSchema Checking existence of xxx/prisma/schema.prisma +1ms
prisma:getSchema Reading schema from single file xxx/prisma/schema.prisma +0ms
prisma:getSchema Reading schema from multiple files xxx/prisma/schema +1ms
prisma:getSchema Reading schema from multiple files xxx/prisma/schema +0ms
prisma:getConfig Using getConfig Wasm +0ms
prisma:getConfig config data retrieved without errors in getConfig Wasm +1ms
prisma:cli:checkpoint runCheckpointClientCheck(): Execution time for getting info: 8.311571000005642 ms +0ms
prisma:cli:checkpoint runCheckpointClientCheck(): Execution time for "await checkpoint.check(data)": 32.38349900000321 ms +33ms

> @prisma/[email protected] postinstall
> node scripts/postinstall.js


added 28 packages in 44s

Expected behavior

Self-hosted binary url: https://oceanbase-prisma-builds.s3.ap-southeast-1.amazonaws.com/all_commits/96fa66f2f130d66795d9f79dd431c678a9c7104e/darwin/libquery_engine.dylib.node.gz

  • Prisma binary download url should be https://oceanbase-prisma-builds.s3.ap-southeast-1.amazonaws.com instead of https://binaries.prisma.sh.
  • Prisma binary download version should be 96fa66f2f130d66795d9f79dd431c678a9c7104e instead of 06fc58a368dc7be9fbbbe894adf8d445d208c284.

Prisma information

  • npx prisma debug can load correct env:
...
For downloading engines
- PRISMA_ENGINES_MIRROR: `https://oceanbase-prisma-builds.s3.ap-southeast-1.amazonaws.com`
- PRISMA_BINARIES_MIRROR (deprecated):
- PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING:
- BINARY_DOWNLOAD_VERSION: `96fa66f2f130d66795d9f79dd431c678a9c7104e`
...

Environment & setup

  • OS: macOS
  • Database: MySQL
  • Node.js version: v21.6.2

Prisma Version

- prisma: 5.20.0
- @prisma/client: 5.20.0
@dengfuping dengfuping added the kind/bug A reported bug. label Oct 15, 2024
@SevInf SevInf added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. topic: engine download labels Oct 15, 2024
@dengfuping
Copy link
Author

dengfuping commented Oct 16, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. topic: engine download
Projects
None yet
Development

No branches or pull requests

2 participants