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
Comments
@JMH0113 This is unexpected to me. 🤔 Could you try to run |
@Jolg42 |
@JMH0113 Sorry, this should work better on Windows
|
@Jolg42 Here's what it looks like when you run
|
@JMH0113 Thanks! Could you try running these commands and sharing the output?
I suspect that one of these is set with an invalid value. |
@Jolg42 |
@Jolg42
|
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 Can you maybe try via a VPN? That often solves such problems. |
@Jolg42 |
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! |
Hi! I'm getting the same error when running This is the output when i run the command: Downloading Prisma engines for Node-API for windows [ ] 0%Error: Invalid URL Thanks! |
@ezeamin |
Not in a rush, but if it continues to exist, I will follow up your method @JMH0113. Thanks! |
@ezeamin @JMH0113 You first started to see this problem with Prisma 5.0.0? Only on Windows? 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 |
@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. |
@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. |
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
and it stayed the same: set NO_PROXY=* && npx prisma -v
> Downloading Prisma engines for Node-API for windows [ ] 0%Error: Invalid URL |
@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: You can try it
|
@Jolg42 This is run
|
@Jolg42 Hello! Running the same command as @JMH0113, I got a successful execution. This is, I then tried 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. |
Hmm interesting:
Does this IP address and port
Same for you @JMH0113, does the port |
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
I also checked around and from what I see the protocol is required when using |
So the error that you saw @JMH0113 @ezeamin was actually to be expected, though very confusing Also check the previous comment from @janpio #20302 (comment) The PR will be merged to improve the error message here. |
Hello @janpio, effectively, this IP address is my workstation DNS server IP, and gateway as well. |
npx prisma
, Error: Invalid URL
TypeError [ERR_INVALID_URL]: Invalid URL
when HTTP(S)_PROXY
en var has is set to a URL without a protocol
Note: the new behavior implemented in the PR is
|
Did you set this manually as the value of |
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. |
I'll close this, as the PR merged improved the behavior here. If there is any remaining problem, let us know 🙌🏼 |
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
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: