Andrew Leung
05/11/2022, 7:13 PMAndrew Leung
05/11/2022, 7:13 PMPRISMA_ENGINES_MIRROR, the deprecated value says PRISMA_BINARY_MIRROR, the Github Issues specify PRISMA_BINARIES_MIRROR https://github.com/prisma/docs/issues/447
I’m using @prisma/client 3.14.0.
And when I run the yarn install command, I can see that the script continues to download from <https://binaries.prisma.sh> regardless of what I have set in the ENV (FWIW, I’ve set them all, because it’s not clear which is the correct one)
Could someone point me the location of the code where this ENV variable is being used?Austin
05/11/2022, 8:55 PMAndrew Leung
05/11/2022, 9:00 PMAndrew Leung
05/11/2022, 9:01 PMPRISMA_ENGINES_MIRROR env too?Andrew Leung
05/11/2022, 9:02 PMAustin
05/11/2022, 9:08 PMAndrew Leung
05/11/2022, 9:17 PMPRISMA_CLI_QUERY_ENGINE_TYPE="binary"
PRISMA_CLIENT_ENGINE_TYPE="binary"
PRISMA_ENGINES_MIRROR="<http://prisma-builds.s3-eu-west-1.amazonaws.com>"
PRISMA_BINARY_MIRROR="<http://prisma-builds.s3-eu-west-1.amazonaws.com>"
PRISMA_BINARIES_MIRROR = "<http://prisma-builds.s3-eu-west-1.amazonaws.com>"
So these are all set now in the environment. My hope is that by doing so, instead of downloading from `https://binaries.prisma.sh, i go to s3 url above (which I saw solved the issue for some people in github issues https://github.com/prisma/prisma/issues/3554, in fact, if I try to reach out to the s3 url instead, everything works fine, so this is my current approach)
But even with all these set above, during the postinstall script of prisma, it still seems to want to go to binaries.prisma.sh (which stalls in the Jenkins env i’m working in)Joël
I’m usingCheck that you are also using the same version for the Prisma CLI.@prisma/client 3.14.0
prisma
About the MIRROR env
You only need to set PRISMA_ENGINES_MIRROR , PRISMA_BINARIES_MIRROR is deprecated and was the old nameJoël
PRISMA_CLI_QUERY_ENGINE_TYPE & PRISMA_CLIENT_ENGINE_TYPE these are not needed.
The default engine is library (Node-API), if that works for you, I can recommend keeping the default and removing these env varsJoël
PRISMA_ENGINES_MIRROR is always set
= available in the env, before npm install and before any prisma CLI command are called
That should work.Joël
prisma CLI (and which version)?Andrew Leung
05/12/2022, 2:17 PM@prisma/client is 3.14.0. My dev dependency prisma is also 3.14.0.
We are running in a Jenkins CI environment, so the environment variables are set at the initialization of the worker. I have verified using a printenv step to ensure that the environments were set before i call yarn install.
I will try again with all your ENV recommendations, and trim it down to:
PRISMA_ENGINES_MIRROR = "<http://prisma-builds.s3-eu-west-1.amazonaws.com>"Andrew Leung
05/12/2022, 2:31 PMprintenv shows
PRISMA_ENGINES_MIRROR=<http://prisma-builds.s3-eu-west-1.amazonaws.com>
then yarn install --verbose is called
verbose 6.043205522 Performing "GET" request to "<https://registry.yarnpkg.com/@prisma/client/-/client-3.14.0.tgz>".
verbose 6.044696994 Performing "GET" request to "<https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-3.14.0-36.2b0c12756921c891fec4f68d9444e18c7d5d4a6a.tgz>".
verbose 14.318655404 Performing "GET" request to "<https://registry.yarnpkg.com/prisma/-/prisma-3.14.0.tgz>".
verbose 14.326004642 Performing "GET" request to "<https://registry.yarnpkg.com/@prisma/engines/-/engines-3.14.0-36.2b0c12756921c891fec4f68d9444e18c7d5d4a6a.tgz>".
verbose 23.909147856 Selecting "prisma@3.14.0" at level 0 as the peer dependency of "@prisma/client@3.14.0".
As you can see from the yarn install output, it requested the expected artifacts.
It'll take about 30 mins before the yarn install command will time out (as I mentioned before, the machine is unable to reach <https://binaries.prisma.sh> thus the workaround to hit s3 directly (I ran
+ sudo wget --spider <http://prisma-builds.s3-eu-west-1.amazonaws.com>
Spider mode enabled. Check if remote file exists.
--2022-05-12 14:21:59-- <http://prisma-builds.s3-eu-west-1.amazonaws.com/>
Resolving <http://prisma-builds.s3-eu-west-1.amazonaws.com|prisma-builds.s3-eu-west-1.amazonaws.com> (<http://prisma-builds.s3-eu-west-1.amazonaws.com|prisma-builds.s3-eu-west-1.amazonaws.com>)... 52.218.84.75
Connecting to <http://prisma-builds.s3-eu-west-1.amazonaws.com|prisma-builds.s3-eu-west-1.amazonaws.com> (<http://prisma-builds.s3-eu-west-1.amazonaws.com|prisma-builds.s3-eu-west-1.amazonaws.com>)|52.218.84.75|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/xml]
Remote file exists.
so I know it can reach this domain. The same command to binaries.prisma.sh results in a hang (enterprise whitelisting likely the issue here, but is infinitely more difficult to solve).
yarn install eventually fails with the following:
verbose 1922.87076231 Error: request to <https://binaries.prisma.sh/all_commits/2b0c12756921c891fec4f68d9444e18c7d5d4a6a/debian-openssl-1.1.x/libquery_engine.so.node.gz.sha256> failed, reason: read ETIMEDOUT
which implies that the command still doesn't reach the value set in PRISMA_ENGINES_MIRROR