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

CLI errors with TypeError [ERR_INVALID_URL]: Invalid URL when HTTP(S)_PROXY en var has is set to a URL without a protocol #20302

Closed
JMH0113 opened this issue Jul 20, 2023 · 30 comments
Assignees
Labels
5.0.0 bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. topic: cli topic: engine download topic: windows
Milestone

Comments

@JMH0113
Copy link

JMH0113 commented Jul 20, 2023

Bug description

npx prisma studio
cue me:
Downloading Prisma engines for Node-API for windows [ ] 0%Error: Invalid URL

"prisma": "^5.0.0"

How to reproduce

npx prisma xxx

Expected behavior

No response

Prisma information

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

Environment & setup

  • OS: windows
  • Database: MySQL
  • Node.js version: V16.18.0

Prisma Version

5.0.0
@JMH0113 JMH0113 added the kind/bug A reported bug. label Jul 20, 2023
@Jolg42
Copy link
Member

Jolg42 commented Jul 20, 2023

@JMH0113 This is unexpected to me. 🤔

Could you try to run DEBUG=* npx prisma -v and share the output here?

@Jolg42 Jolg42 added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. topic: cli topic: windows team/schema Issue for team Schema. team/client Issue for team Client. topic: engine download labels Jul 20, 2023
@JMH0113
Copy link
Author

JMH0113 commented Jul 20, 2023

@Jolg42
I do not know run DEBUG=* npx prisma -v,please tell me step by step.
I run DEBUG=* npx prisma -v by vscode terminal,has error.

@Jolg42
Copy link
Member

Jolg42 commented Jul 20, 2023

@JMH0113 Sorry, this should work better on Windows

set DEBUG=* && npx prisma -v

@JMH0113
Copy link
Author

JMH0113 commented Jul 20, 2023

@Jolg42 Here's what it looks like when you run set DEBUG=* && npx prisma -v

prisma:engines  binaries to download libquery-engine, migration-engine +0ms
  prisma:download  file D:\pyq-api-node\node_modules\@prisma\engines\query_engine-windows.dll.node does not exist and must be downloaded +0ms
  prisma:download  file D:\pyq-api-node\node_modules\@prisma\engines\migration-engine-windows.exe does not exist and must be downloaded +1ms
  prisma:download  Downloading https://binaries.prisma.sh/all_commits/4bc8b6e1b66cb932731fb1bdbbc550d1e010de81/windows/query_engine.dll.node.gz to D:\pyq-api-node\node_modules\@prisma\engines\query_engine-windows.dll.node +2ms
> Downloading Prisma engines for Node-API for windows [                    ] 0%Error: TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:387:5)
    at URL.onParseError (node:internal/url:565:9)
    at new URL (node:internal/url:641:5)
    at new HttpsProxyAgent2 (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:20628:50)
    at getProxyAgent (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22877:12)
    at fetchChecksum (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22889:14)
    at downloadZip (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22921:53)
    at downloadBinary (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:23295:42)
    at async Promise.all (index 0)
    at async download (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:23099:5)

@Jolg42
Copy link
Member

Jolg42 commented Jul 20, 2023

@JMH0113 Thanks! Could you try running these commands and sharing the output?

  • echo %PRISMA_BINARIES_MIRROR%
  • echo %PRISMA_ENGINES_MIRROR%

I suspect that one of these is set with an invalid value.
You can then unset it/them, see https://zwbetz.com/windows-environment-variables-in-command-prompt/

@JMH0113
Copy link
Author

JMH0113 commented Jul 20, 2023

@Jolg42
echo %PRISMA_BINARIES_MIRROR%
echo %PRISMA_ENGINES_MIRROR%
Thanks for the pointer.
Both commands are not outputting properly.
How should I fix them?

@JMH0113
Copy link
Author

JMH0113 commented Jul 20, 2023

@Jolg42
I searched for two mirrors and set the variables, still does not execute properly.

D:\pyq-api-node>set  PRISMA_ENGINES_MIRROR=https://registry.npmmirror.com/-/binary/prisma

D:\pyq-api-node>echo %PRISMA_ENGINES_MIRROR%
https://registry.npmmirror.com/-/binary/prisma

D:\pyq-api-node>npx prisma init
  prisma:engines  binaries to download libquery-engine, migration-engine +0ms
  prisma:download  file D:\pyq-api-node\node_modules\@prisma\engines\query_engine-windows.dll.node does not exist and must be downloaded +0ms
  prisma:download  file D:\pyq-api-node\node_modules\@prisma\engines\migration-engine-windows.exe does not exist and must be downloaded +1ms
  prisma:download  Downloading https://registry.npmmirror.com/-/binary/prisma/all_commits/4bc8b6e1b66cb932731fb1bdbbc550d1e010de81/windows/query_engine.dll.node.gz to D:\pyq-api-node\node_modules\@prisma\engines\query_engine-windows.dll.node +3ms
> Downloading Prisma engines for Node-API for windows [                    ] 0%Error: TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:387:5)
    at URL.onParseError (node:internal/url:565:9)
    at new URL (node:internal/url:641:5)
    at new HttpsProxyAgent2 (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:20628:50)
    at getProxyAgent (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22877:12)
    at fetchChecksum (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22889:14)
    at downloadZip (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22921:53)
    at downloadBinary (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:23295:42)
    at async Promise.all (index 0)
    at async download (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:23099:5)

D:\pyq-api-node>echo %PRISMA_BINARIES_MIRROR%
%PRISMA_BINARIES_MIRROR%

D:\pyq-api-node>set PRISMA_BINARIES_MIRROR=http://prisma-builds.s3-eu-west-1.amazonaws.com 

D:\pyq-api-node>echo %PRISMA_BINARIES_MIRROR%
http://prisma-builds.s3-eu-west-1.amazonaws.com

D:\pyq-api-node>npx prisma init
  prisma:engines  binaries to download libquery-engine, migration-engine +0ms
  prisma:download  file D:\pyq-api-node\node_modules\@prisma\engines\query_engine-windows.dll.node does not exist and must be downloaded +0ms
  prisma:download  file D:\pyq-api-node\node_modules\@prisma\engines\migration-engine-windows.exe does not exist and must be downloaded +1ms
  prisma:download  Downloading http://prisma-builds.s3-eu-west-1.amazonaws.com/all_commits/4bc8b6e1b66cb932731fb1bdbbc550d1e010de81/windows/query_engine.dll.node.gz to D:\pyq-api-node\node_modules\@prisma\engines\query_engine-windows.dll.node +3ms
> Downloading Prisma engines for Node-API for windows [                    ] 0%Error: TypeError [ERR_INVALID_URL]: Invalid URL
    at new NodeError (node:internal/errors:387:5)
    at URL.onParseError (node:internal/url:565:9)
    at new URL (node:internal/url:641:5)
    at new HttpProxyAgent2 (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:20396:50)
    at getProxyAgent (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22874:12)
    at fetchChecksum (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22889:14)
    at downloadZip (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:22921:53)
    at downloadBinary (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:23295:42)
    at async Promise.all (index 0)
    at async download (D:\pyq-api-node\node_modules\@prisma\engines\dist\index.js:23099:5)

D:\pyq-api-node>

@janpio
Copy link
Member

janpio commented Jul 22, 2023

https://registry.npmmirror.com/-/binary/prisma is not a valid mirror for our engine file CDN, unfortunately.
http://prisma-builds.s3-eu-west-1.amazonaws.com is a backup, but also seems to be causing problems for you.

Am I assuming correctly that you are behind some kind of firewall that is blocking certain providers and servers?

The only other aliases we have are https://beepbop.prisma.sh/ and https://pub-539cb966021b40deb16bf80ba387cb36.r2.dev/, but both are also hosted at Cloudflare and potentially blocked. Please try them.

Can you maybe try via a VPN? That often solves such problems.

@janpio janpio changed the title npx prisma Error: Invalid URL npx prisma, Error: Invalid URL Jul 22, 2023
@JMH0113
Copy link
Author

JMH0113 commented Jul 23, 2023

@Jolg42
But I can jump to the chorme download by clicking on the url after Downliading. I've manually downloaded these files and placed them in the corresponding node_modules directory, and it's working fine now.
There's another question I'd like to ask.Why don't you just install these files that require additional downloads when installing prisma as well?

@janpio
Copy link
Member

janpio commented Jul 23, 2023

Why don't you just install these files that require additional downloads when installing prisma as well?

Because these are different depending on your operating system, an on Linux on OpenSSL version and system libraries - so it would be far to many, that you do not actually need locally.

@JMH0113
Copy link
Author

JMH0113 commented Jul 23, 2023

Why don't you just install these files that require additional downloads when installing prisma as well?

Because these are different depending on your operating system, an on Linux on OpenSSL version and system libraries - so it would be far to many, that you do not actually need locally.

I see.Thank you for your answer!

@ezeamin
Copy link

ezeamin commented Jul 24, 2023

Hi! I'm getting the same error when running prisma generate command. I'm on Windows on my Office PC, just downloaded and installed prisma via npm. I'm not using any proxy, and as far as I know, my employer doesn't block any known connections. I have my firewall down as well. I don't have any other troubles with other libraries. I run this command on my home PC last week and everything went fine.

This is the output when i run the command:

Downloading Prisma engines for Node-API for windows [   ] 0%Error: Invalid URL

Thanks!

@JMH0113
Copy link
Author

JMH0113 commented Jul 24, 2023

@ezeamin
I currently solved this problem by manually downloading the required files, if you are in a hurry to use it, you can turn on DEBUG mode and then download the prompted URL and move it to the corresponding node_modules directory.Just run the prisma command again.

@Jolg42 Jolg42 added the 5.0.0 label Jul 24, 2023
@ezeamin
Copy link

ezeamin commented Jul 24, 2023

Not in a rush, but if it continues to exist, I will follow up your method @JMH0113. Thanks!

@Jolg42
Copy link
Member

Jolg42 commented Jul 24, 2023

@ezeamin @JMH0113 You first started to see this problem with Prisma 5.0.0? Only on Windows?
And using Node.js v16.13 or more recent?

I'm curious to know if it's a regression here or if the same error happens on previous versions, if you could try and confirm that downgrading to v4 like 4.16.2 or 4.15.0 works and does not have this issue it would really help 🙏🏼

@JMH0113
Copy link
Author

JMH0113 commented Jul 24, 2023

@Jolg42 I was just learning about prisma's node version 16.18. i had tried to follow 4.16.2 and it didn't solve the problem.

@ezeamin
Copy link

ezeamin commented Jul 24, 2023

@Jolg42 I'm using node 19.2.0. I haven't used Prisma so much before, so unfortunately I cannot answer that to you. However, I will try downgrading it to 4.16.2.

I'm now using pnpm, but i think npm will give the same output. This is the output when i run the install script.

node_modules/.pnpm/@prisma+engines@4.16.2/node_modules/@prisma/engines: Running ponode_modules/.pnpm/@prisma+engines@4.16.2/node_modules/@prisma/engines: Running postinstall script, done in 304ms
node_modules/.pnpm/prisma@4.16.2/node_modules/prisma: Running preinstall script, done in 157ms
node_modules/.pnpm/@prisma+client@5.0.0_prisma@4.16.2/node_modules/@prisma/client:node_modules/.pnpm/@prisma+client@5.0.0_prisma@4.16.2/node_modules/@prisma/client: Running postinstall script, done in 764ms

The error is still there, and it's the same.

@Jolg42
Copy link
Member

Jolg42 commented Jul 24, 2023

@ezeamin @JMH0113 Is it possible that you have one of these environment variables defined?

  • HTTP_PROXY
  • HTTPS_PROXY

You could try setting NO_PROXY=* when installing to ignore these env vars and see if that changes anything.

@ezeamin
Copy link

ezeamin commented Jul 24, 2023

As far as I know, i don't have any of those set. The project i'm running the command on has just been created last week, and is a basic one. Nonetheless, I tried running the command on separate cmds on different projects/folders, and nothing seemed to work. I tried to set NO_PROXY like you recommended at

@JMH0113 Sorry, this should work better on Windows

set DEBUG=* && npx prisma -v

and it stayed the same:

set NO_PROXY=* && npx prisma -v
> Downloading Prisma engines for Node-API for windows [                    ] 0%Error: Invalid URL

Jolg42 added a commit that referenced this issue Jul 27, 2023
@Jolg42 Jolg42 self-assigned this Jul 27, 2023
@Jolg42
Copy link
Member

Jolg42 commented Jul 27, 2023

@JMH0113 @ezeamin I opened a PR to improve the debug / errors in the download logic. I suspect that something is happening with the HTTP(S) Proxy Agent for you.

Could you try out this specific version: 5.1.0-integration-joel-improve-download.1 and share the logs?

You can try it

# First, make sure DEBUG=* or DEBUG=prisma* is set
# Then run
npx prisma@5.1.0-integration-joel-improve-download.1 

@Jolg42 Jolg42 added this to the 5.1.0 milestone Jul 27, 2023
@JMH0113
Copy link
Author

JMH0113 commented Jul 28, 2023

@Jolg42 This is run set DEBUG=* && npx prisma@5.1.0-integration-joel-improve-download.1 result.

D:\pyq-code\pyq-api-node>set DEBUG=* && npx prisma@5.1.0-integration-joel-improve-download.1
  https-proxy-agent:agent creating new HttpsProxyAgent instance: { host: '127.0.0.1', port: '7890', protocol: 'http:', path: '/', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +0ms
  agent-base Resolving socket for 'https:' request: 'GET /prisma' +0ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +4ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +0ms
  https-proxy-agent:agent Upgrading socket connection to TLS +3ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npm.taobao.org', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { accept: [ 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'pacote-pkg-id': [ 'registry:prisma' ], 'pacote-req-type': [ 'packument' ], 'pacote-version': [ '15.2.0' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], connection: [ 'keep-alive' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +74ms
  https-proxy-agent:parse-proxy-response onclose had error false +74ms
  agent-base Resolving socket for 'https:' request: 'GET /prisma' +8ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +80ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +7ms
  https-proxy-agent:agent Upgrading socket connection to TLS +1ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { accept: [ 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'pacote-pkg-id': [ 'registry:prisma' ], 'pacote-req-type': [ 'packument' ], 'pacote-version': [ '15.2.0' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], 'if-none-match': [ 'W/"b320d738cb9d9c8769b0816212aedc50292febbb"' ], connection: [ 'keep-alive' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +90ms
  https-proxy-agent:parse-proxy-response onclose had error false +93ms
Need to install the following packages:
  prisma@5.1.0-integration-joel-improve-download.1
Ok to proceed? (y) y
  agent-base Resolving socket for 'https:' request: 'GET /prisma' +19s
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +19s
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +19s
  https-proxy-agent:agent Upgrading socket connection to TLS +5ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npm.taobao.org', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { accept: [ 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'pacote-pkg-id': [ 'registry:prisma' ], 'pacote-req-type': [ 'packument' ], 'pacote-version': [ '15.2.0' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], connection: [ 'keep-alive' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +109ms
  https-proxy-agent:parse-proxy-response onclose had error false +108ms
  agent-base Resolving socket for 'https:' request: 'GET /@prisma%2fengines' +105ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +210ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +104ms
  https-proxy-agent:agent Upgrading socket connection to TLS +1ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npm.taobao.org', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { accept: [ 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'pacote-pkg-id': [ 'registry:@prisma/engines' ], 'pacote-req-type': [ 'packument' ], 'pacote-version': [ '15.2.0' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], connection: [ 'keep-alive' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +68ms
  https-proxy-agent:parse-proxy-response onclose had error false +68ms
  agent-base Resolving socket for 'https:' request: 'GET /@prisma%2fengines' +9ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +75ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +8ms
  https-proxy-agent:agent Upgrading socket connection to TLS +1ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { accept: [ 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'pacote-pkg-id': [ 'registry:@prisma/engines' ], 'pacote-req-type': [ 'packument' ], 'pacote-version': [ '15.2.0' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], 'if-none-match': [ 'W/"d5981f894c3e2787a0b15389bda473228d896eb3"' ], connection: [ 'keep-alive' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +829ms
  https-proxy-agent:parse-proxy-response onclose had error false +830ms
  agent-base Resolving socket for 'https:' request: 'POST /-/npm/v1/security/advisories/bulk' +42ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +870ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +44ms
  https-proxy-agent:agent Upgrading socket connection to TLS +4ms
  agent-base Resolving socket for 'https:' request: 'GET /@prisma/engines/-/engines-5.1.0-integration-joel-improve-download.1.tgz' +14ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +11ms
  agent-base Resolving socket for 'https:' request: 'GET /prisma/-/prisma-5.1.0-integration-joel-improve-download.1.tgz' +2ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +1ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +13ms
  https-proxy-agent:agent Upgrading socket connection to TLS +2ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +2ms
  https-proxy-agent:agent Upgrading socket connection to TLS +1ms
  https-proxy-agent:parse-proxy-response onclose had error false +135ms
  agent-base Resolving socket for 'https:' request: 'GET /packages/%40prisma/engines/5.1.0-integration-joel-improve-download.1/engines-5.1.0-integration-joel-improve-download.1.tgz' +141ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +138ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +5ms
  https-proxy-agent:agent Upgrading socket connection to TLS +3ms
  https-proxy-agent:parse-proxy-response onclose had error false +9ms
  agent-base Resolving socket for 'https:' request: 'GET /packages/prisma/5.1.0-integration-joel-improve-download.1/prisma-5.1.0-integration-joel-improve-download.1.tgz' +12ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +9ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +2ms
  https-proxy-agent:agent Upgrading socket connection to TLS +2ms
  https-proxy-agent:parse-proxy-response onclose had error false +382ms
  agent-base Resolving socket for 'https:' request: 'GET /-/npm/v1/security/advisories/bulk' +385ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +384ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +4ms
  https-proxy-agent:agent Upgrading socket connection to TLS +1ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'cdn.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { connection: [ 'keep-alive' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'pacote-integrity': [ 'sha512-lXJSzPQGH5hK4kQCdjzT0z9M36cvT5r/MLWLxIcyEPvM4UH6KCL5u8+RK/O5+2qyE/Q5PEQb8o6Cb+BL61SieQ==' ], 'pacote-pkg-id': [ 'remote:@prisma/engines@https://registry.npmmirror.com/@prisma/engines/-/engines-5.1.0-integration-joel-improve-download.1.tgz' ], 'pacote-req-type': [ 'tarball' ], 'pacote-version': [ '15.2.0' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], Accept: [ '*/*' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol:
 undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +170ms
  https-proxy-agent:parse-proxy-response onclose had error false +170ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { connection: [ 'keep-alive' ], 'content-encoding': [ 'gzip' ], 'content-type': [ 'application/json' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], Accept: [ '*/*' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +129ms
  https-proxy-agent:parse-proxy-response onclose had error false +130ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'cdn.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { connection: [ 'keep-alive' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'pacote-integrity': [ 'sha512-fPliGY5CHlqj9r31PErwPysum+hUvaZqbtKekirzu83dvX0T4q8H/Mc5XRVuMduovn1HPYUtDiMNZjHARNvQ/w==' ], 'pacote-pkg-id': [ 'remote:prisma@https://registry.npmmirror.com/prisma/-/prisma-5.1.0-integration-joel-improve-download.1.tgz' ], 'pacote-req-type': [ 'tarball' ], 'pacote-version': [ '15.2.0' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], Accept: [ '*/*' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +161ms
  https-proxy-agent:parse-proxy-response onclose had error false +159ms
  agent-base Resolving socket for 'https:' request: 'GET /-/npm/v1/security/advisories/bulk' +10s/5.1.0-integration-joel-improve-download.1/prisma-5.1.0-integration-joel-improve-download.1.tgz 1015ms (cache miss)
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +10s
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +10sation-joel-improve-download.1/prisma-5.1.0-integration-joel-improve-download.1.tgz 1015ms (cache miss)
  https-proxy-agent:agent Upgrading socket connection to TLS +4ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { connection: [ 'keep-alive' ], 'content-encoding': [ 'gzip' ], 'content-type': [ 'application/json' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], Accept: [ '*/*' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +607ms
  https-proxy-agent:parse-proxy-response onclose had error false +605ms
  agent-base Resolving socket for 'https:' request: 'GET /-/npm/v1/security/advisories/bulk' +1ma/5.1.0-integration-joel-improve-download.1/prisma-5.1.0-integration-joel-improve-download.1.tgz 1015ms (cache miss)
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +1m
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +1m
  https-proxy-agent:agent Upgrading socket connection to TLS +3ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { connection: [ 'keep-alive' ], 'content-encoding': [ 'gzip' ], 'content-type': [ 'application/json' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], Accept: [ '*/*' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +1s
  agent-base Resolving socket for 'https:' request: 'POST /-/npm/v1/security/audits/quick' +9ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +1s
  https-proxy-agent:parse-proxy-response onclose had error false +1s
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +1ms
  https-proxy-agent:agent Upgrading socket connection to TLS +3ms
  https-proxy-agent:parse-proxy-response onclose had error false +96msmmirror.com/packages/prisma/5.1.0-integration-joel-improve-download.1/prisma-5.1.0-integration-joel-improve-download.1.tgz 1015ms (cache miss)
  agent-base Resolving socket for 'https:' request: 'GET /-/npm/v1/security/audits/quick' +107ms
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +104ms
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +11ms
  https-proxy-agent:agent Upgrading socket connection to TLS +2ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { connection: [ 'keep-alive' ], 'content-encoding': [ 'gzip' ], 'content-type': [ 'application/json' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], Accept: [ '*/*' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +257ms
  https-proxy-agent:parse-proxy-response onclose had error false +256ms
  agent-base Resolving socket for 'https:' request: 'GET /-/npm/v1/security/audits/quick' +10ssma/5.1.0-integration-joel-improve-download.1/prisma-5.1.0-integration-joel-improve-download.1.tgz 1015ms (cache miss)
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +10s
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +10s
  https-proxy-agent:agent Upgrading socket connection to TLS +2ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { connection: [ 'keep-alive' ], 'content-encoding': [ 'gzip' ], 'content-type': [ 'application/json' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], Accept: [ '*/*' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +588ms
  https-proxy-agent:parse-proxy-response onclose had error false +589ms
  agent-base Resolving socket for 'https:' request: 'GET /-/npm/v1/security/audits/quick' +1misma/5.1.0-integration-joel-improve-download.1/prisma-5.1.0-integration-joel-improve-download.1.tgz 1015ms (cache miss)
  https-proxy-agent:agent Creating `net.Socket`: { host: '127.0.0.1', port: 7890, protocol: 'http:', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +1m
  https-proxy-agent:parse-proxy-response got proxy server response: 'HTTP/1.1 200 Connection established' +1mration-joel-improve-download.1/prisma-5.1.0-integration-joel-improve-download.1.tgz 1015ms (cache miss)
  https-proxy-agent:agent Upgrading socket connection to TLS +4ms
  agent-base Freeing socket 'TLSSocket' { auth: '', host: 'registry.npmmirror.com', port: 443, protocol: 'https:', method: 'GET', headers: [Object: null prototype] { connection: [ 'keep-alive' ], 'content-encoding': [ 'gzip' ], 'content-type': [ 'application/json' ], 'npm-auth-type': [ 'web' ], 'npm-command': [ 'exec' ], 'user-agent': [ 'npm/9.8.0 node/v18.17.0 win32 x64 workspaces/false' ], Accept: [ '*/*' ], 'Accept-Encoding': [ 'gzip,deflate' ] }, ca: null, cert: null, ciphers: undefined, clientCertEngine: undefined, crl: undefined, dhparam: undefined, ecdhCurve: undefined, family: undefined, honorCipherOrder: undefined, key: null, passphrase: undefined, pfx: undefined, rejectUnauthorized: false, secureOptions: undefined, secureProtocol: undefined, servername: undefined, sessionIdContext: undefined, timeout: 300000, secureEndpoint: true } +651ms
  https-proxy-agent:parse-proxy-response onclose had error false +653ms

Prisma is a modern DB toolkit to query, migrate and model your database (https://prisma.io)

Usage

  $ prisma [command]

Commands

            init   Set up Prisma for your app
        generate   Generate artifacts (e.g. Prisma Client)
              db   Manage your database schema and lifecycle
         migrate   Migrate your database
          studio   Browse your data with Prisma Studio
        validate   Validate your Prisma schema
          format   Format your Prisma schema

Flags

     --preview-feature   Run Preview Prisma commands

Examples

  Set up a new Prisma project
  $ prisma init

  Generate artifacts (e.g. Prisma Client)
  $ prisma generate

  Browse your data
  $ prisma studio

  Create migrations from your Prisma schema, apply them to the database, generate artifacts (e.g. Prisma Client)
  $ prisma migrate dev

  Pull the schema from an existing database, updating the Prisma schema
  $ prisma db pull

  Push the Prisma schema state to the database
  $ prisma db push

  Validate your Prisma schema
  $ prisma validate

  Format your Prisma schema
  $ prisma format

  prisma:getConfig  Using getConfig Wasm +0ms
  prisma:getConfig  config data retrieved without errors in getConfig Wasm +2ms

@ezeamin
Copy link

ezeamin commented Jul 28, 2023

@Jolg42 Hello! Running the same command as @JMH0113, I got a successful execution. This is, set DEBUG=* && npx prisma@5.1.0-integration-joel-improve-download.1

I then tried set DEBUG=* && npx prisma@5.1.0-integration-joel-improve-download.1 generate and it successfully connected everything.

Bah, it says PrismaClient was successfully generated, but the whole console log says this:

Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
An error occurred in getProxyAgent(), no proxy agent will be used. Error: Error while instantiating HttpsProxyAgent with URL: "172.23.23.250:8080"
TypeError [ERR_INVALID_URL]: Invalid URL
Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"
    at getProxyAgent (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86465:15)
    at fetchChecksum (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86485:14)
    at retries (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86520:33)
    at RetryOperation._fn (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29894:26)
    at RetryOperation.attempt (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29720:12)
    at C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29892:17
    at new Promise (<anonymous>)
    at pRetry (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29884:39)
    at downloadZip (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86518:67)
    at downloadBinary (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86932:42)
An error occurred in getProxyAgent(), no proxy agent will be used. Error: Error while instantiating HttpsProxyAgent with URL: "172.23.23.250:8080"
TypeError [ERR_INVALID_URL]: Invalid URL
Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"
    at getProxyAgent (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86465:15)
    at fetchChecksum (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86485:14)
    at retries (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86520:54)
    at RetryOperation._fn (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29894:26)
    at RetryOperation.attempt (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29720:12)
    at C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29892:17
    at new Promise (<anonymous>)
    at pRetry (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29884:39)
    at downloadZip (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86518:67)
    at downloadBinary (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86932:42)
An error occurred in getProxyAgent(), no proxy agent will be used. Error: Error while instantiating HttpsProxyAgent with URL: "172.23.23.250:8080"
TypeError [ERR_INVALID_URL]: Invalid URL
Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"
    at getProxyAgent (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86465:15)
    at result.retries (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86531:16)
    at RetryOperation._fn (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29894:26)
    at RetryOperation.attempt (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29720:12)
    at C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29892:17
    at new Promise (<anonymous>)
    at pRetry (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29884:39)
    at downloadZip (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86527:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async downloadBinary (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86932:36)
> Downloading Prisma engines for Node-API for windows [                    ] 0%An error occurred in getProxyAgent(), no proxy agent will be used. Error: Error while instantiating HttpsProxyAgent with URL: "172.23.23.250:8080"
TypeError [ERR_INVALID_URL]: Invalid URL
Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"
    at getProxyAgent (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86465:15)
    at fetchChecksum (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86485:14)
    at retries (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86520:33)
    at RetryOperation._fn (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29894:26)
    at RetryOperation.attempt (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29720:12)
    at C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29892:17
    at new Promise (<anonymous>)
    at pRetry (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29884:39)
    at downloadZip (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86518:67)
    at downloadBinary (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86932:42)
An error occurred in getProxyAgent(), no proxy agent will be used. Error: Error while instantiating HttpsProxyAgent with URL: "172.23.23.250:8080"
TypeError [ERR_INVALID_URL]: Invalid URL
Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"
    at getProxyAgent (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86465:15)
    at fetchChecksum (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86485:14)
    at retries (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86520:54)
    at RetryOperation._fn (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29894:26)
    at RetryOperation.attempt (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29720:12)
    at C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29892:17
    at new Promise (<anonymous>)
    at pRetry (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29884:39)
    at downloadZip (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86518:67)
    at downloadBinary (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86932:42)
An error occurred in getProxyAgent(), no proxy agent will be used. Error: Error while instantiating HttpsProxyAgent with URL: "172.23.23.250:8080"
TypeError [ERR_INVALID_URL]: Invalid URL
Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"
    at getProxyAgent (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86465:15)
    at result.retries (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86531:16)
    at RetryOperation._fn (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29894:26)
    at RetryOperation.attempt (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29720:12)
    at C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29892:17
    at new Promise (<anonymous>)
    at pRetry (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:29884:39)
    at downloadZip (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86527:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async downloadBinary (C:\Users\Eze Amin\AppData\Local\npm-cache\_npx\5d88d4ef01a1614a\node_modules\prisma\build\index.js:86932:36)

✔ Generated Prisma Client (5.0.0 | library) to .\node_modules\@prisma\client in 160ms       
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client     

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

warn Versions of prisma@5.1.0-integration-joel-improve-download.1 and @prisma/client@5.0.0 don't match.
This might lead to unexpected behavior.
Please make sure they have the same version.

Even after these errors, I'm able to load my application correctly.

@janpio
Copy link
Member

janpio commented Jul 31, 2023

Hmm interesting:

An error occurred in getProxyAgent(), no proxy agent will be used. Error: Error while instantiating HttpsProxyAgent with URL: "172.23.23.250:8080"

Does this IP address and port 172.23.23.250:8080 mean anything to you @ezeamin? It's something internal, not a real server on the internet: https://ipinfo.io/172.23.23.250

https-proxy-agent:agent creating new HttpsProxyAgent instance: { host: '127.0.0.1', port: '7890', protocol: 'http:', path: '/', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +0ms

Same for you @JMH0113, does the port 7890 on localhost ring a bell for you - do you know what software is running there that wants to proxy your requests?

@Jolg42 Jolg42 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. labels Jul 31, 2023
@Jolg42
Copy link
Member

Jolg42 commented Jul 31, 2023

Note about these environment variables in general, I checked if there was any specification for them, I didn't find any.

It looks like a very popular convention that might have originated with curl, see
https://superuser.com/a/1166790
https://curl.se/docs/manpage.html

The environment variables can be specified in lower case or upper case. The lower case version has precedence. http_proxy is an exception as it is only available in lower case.

Using an environment variable to set the proxy has the same effect as using the -x, --proxy option.

http_proxy [protocol://][:port]

Sets the proxy server to use for HTTP.

HTTPS_PROXY [protocol://][:port]

Sets the proxy server to use for HTTPS.

[url-protocol]_PROXY [protocol://][:port]

Sets the proxy server to use for [url-protocol], where the protocol is a protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, SMTP, LDAP, etc.

ALL_PROXY [protocol://][:port]

Sets the proxy server to use if no protocol-specific proxy is set.

NO_PROXY <comma-separated list of hosts/domains>

list of host names that should not go through any proxy. If set to an asterisk '*' only, it matches all hosts. Each name in this list is matched as either a domain name which contains the hostname, or the hostname itself.

This environment variable disables use of the proxy even when specified with the -x, --proxy option. That is NO_PROXY=direct.example.com curl -x http://proxy.example.com/ http://direct.example.com/ accesses the target URL directly, and NO_PROXY=direct.example.com curl -x http://proxy.example.com/ http://somewhere.example.com/ accesses the target URL through the proxy.

The list of host names can also be include numerical IP addresses, and IPv6 versions should then be given without enclosing brackets.

Since 7.86.0, IP addresses can be specified using CIDR notation: an appended slash and number specifies the number of "network bits" out of the address to use in the comparison. For example "192.168.0.0/16" would match all addresses starting with "192.168".

I also checked around and from what I see the protocol is required when using HTTP_PROXY or HTTPS_PROXY env vars.

@Jolg42
Copy link
Member

Jolg42 commented Jul 31, 2023

So the error that you saw @JMH0113 @ezeamin was actually to be expected, though very confusing
-> You would need to either add http:// or https:// to your env var.

Also check the previous comment from @janpio #20302 (comment)

The PR will be merged to improve the error message here.

@ezeamin
Copy link

ezeamin commented Jul 31, 2023

Hmm interesting:

An error occurred in getProxyAgent(), no proxy agent will be used. Error: Error while instantiating HttpsProxyAgent with URL: "172.23.23.250:8080"

Does this IP address and port 172.23.23.250:8080 mean anything to you @ezeamin? It's something internal, not a real server on the internet: https://ipinfo.io/172.23.23.250

https-proxy-agent:agent creating new HttpsProxyAgent instance: { host: '127.0.0.1', port: '7890', protocol: 'http:', path: '/', auth: null, ca: null, cert: null, key: null, timeout: 300001, localAddress: null, maxSockets: 15, rejectUnauthorized: false } +0ms

Same for you @JMH0113, does the port 7890 on localhost ring a bell for you - do you know what software is running there that wants to proxy your requests?

Hello @janpio, effectively, this IP address is my workstation DNS server IP, and gateway as well.

@Jolg42 Jolg42 changed the title npx prisma, Error: Invalid URL CLI errors with TypeError [ERR_INVALID_URL]: Invalid URL when HTTP(S)_PROXY en var has is set to a URL without a protocol Jul 31, 2023
@Jolg42
Copy link
Member

Jolg42 commented Jul 31, 2023

Note: the new behavior implemented in the PR is

  • to show a better error message if the proxy URL is invalid (because parsing it failed)
  • to ignore the error and try downloading without the proxy

@janpio
Copy link
Member

janpio commented Jul 31, 2023

Hello @janpio, effectively, this IP address is my workstation DNS server IP, and gateway as well.

Did you set this manually as the value of HTTP(S)_PROXY on your machine?

@ezeamin
Copy link

ezeamin commented Jul 31, 2023

I have a proxy option with that exact config, but it's disabled. Maybe, and most probably, my organization sets that value internally. However, the "Automatically detect settings" is enabled under the "proxy" panel in my PC's settings menu.

@Jolg42
Copy link
Member

Jolg42 commented Aug 1, 2023

I'll close this, as the PR merged improved the behavior here. If there is any remaining problem, let us know 🙌🏼

@Jolg42 Jolg42 closed this as completed Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0.0 bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. topic: cli topic: engine download topic: windows
Projects
None yet
Development

No branches or pull requests

4 participants