Hi there, I was wondering if someone could clarify...
# orm-help
a
Hi there, I was wondering if someone could clarify what the correct ENV is to specify the download mirror for the Prisma Engines: https://www.prisma.io/docs/reference/api-reference/environment-variables-reference#prisma_engines_mirror
I am seeing a lot of conflicting documentation, here it says
PRISMA_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?
a
Hey Andrew, I responded to your comment in this GitHub Discussions thread.
a
thanks!
By setting it to binary, does that mean it will properly pick up the
PRISMA_ENGINES_MIRROR
env too?
(or whichever one is correct)
a
That’s my hope! Let me know if it doesn’t and we can continue to debug 😄
a
Copy code
PRISMA_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)
j
About the current Prisma version used
I’m using
@prisma/client 3.14.0
.
Check that you are also using the same version for the Prisma CLI
prisma
About the MIRROR env You only need to set
PRISMA_ENGINES_MIRROR
,
PRISMA_BINARIES_MIRROR
is deprecated and was the old name
👍 1
About
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 vars
👍 1
So here if
PRISMA_ENGINES_MIRROR
is always set = available in the env, before
npm install
and before any
prisma
CLI command are called That should work.
plus one +1 1
How/when do you set the env var? How/when do you call
prisma
CLI (and which version)?
a
Good morning, thanks for the replies. Yup, I agree with all your statements.
@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>"
With the above changes:
printenv
shows
Copy code
PRISMA_ENGINES_MIRROR=<http://prisma-builds.s3-eu-west-1.amazonaws.com>
then
yarn install --verbose
is called
Copy code
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
Copy code
+ 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:
Copy code
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