bun icon indicating copy to clipboard operation
bun copied to clipboard

Windows: Bun install fails to download when $Env:http_proxy is set

Open ZTL-UwU opened this issue 1 year ago • 10 comments

What version of Bun is running?

1.0.29

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

  1. Set $Env.http_proxy in $PROFILE e.g. $Env:http_proxy = "http://127.0.0.1:7890"; $Env:https_proxy = "http://127.0.0.1:7890"
  2. Init a bun project
  3. Add some dependencies.

e.g.

bun init
bun add react

What is the expected behavior?

Dependencies being installed correctly.

What do you see instead?

bun add v1.0.29-canary.22 (5147c0ba)
  🔍 @types/bun [11/12]
error: Syscall downloading package manifest @types/bun
  🔍 @types/bun [11/12]
error: Syscall downloading package manifest react
  🔍 typescript [18/18]
error: Syscall downloading package manifest typescript
error: @types/bun@latest failed to resolve
error: react@ failed to resolve

Additional information

With --verbose:

Details

bun add v1.0.29-canary.22 (5147c0ba)
Enqueue package manifest for download: @types/bun

 [0.00ms] [cache hit] react
Enqueue package manifest for download: react
  🔍 Resolving [1/2] [PackageManager] waiting for 2 tasks
Request: GET /@types%2fbun
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Request: GET /react
        If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2"
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /@types%2fbun
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Request: GET /react
        If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2"
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /@types%2fbun
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Request: GET /react
        If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2"
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /@types%2fbun
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Request: GET /react
        If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2"
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /@types%2fbun
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Request: GET /react
        If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2"
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Response: < 200 Connection established

Request: GET /@types%2fbun
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Request: GET /react
        If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2"
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

  🔍 @types/bun [11/12]
error: Response: < 200 Connection established

Syscall downloading package manifest @types/bun
  🔍 react [12/12]
error: Syscall downloading package manifest react
Enqueue package manifest for download: typescript
Request: GET /typescript
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript
        Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
        Connection: keep-alive
        User-Agent: Bun/1.0.29
        Host: registry.npmjs.org
        Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

  🔍 typescript [18/18]
error: Syscall downloading package manifest typescript
warn: warn: Syscall downloading package manifest @types/bun

warn: warn: Syscall downloading package manifest react

warn: warn: Syscall downloading package manifest @types/bun

warn: warn: Syscall downloading package manifest react

warn: warn: Syscall downloading package manifest @types/bun

warn: warn: Syscall downloading package manifest react

warn: warn: Syscall downloading package manifest @types/bun

warn: warn: Syscall downloading package manifest react

warn: warn: Syscall downloading package manifest @types/bun

warn: warn: Syscall downloading package manifest react

warn: warn: Syscall downloading package manifest typescript

warn: warn: Syscall downloading package manifest typescript

warn: warn: Syscall downloading package manifest typescript

warn: warn: Syscall downloading package manifest typescript

warn: warn: Syscall downloading package manifest typescript
error: @types/bun@latest failed to resolve
error: react@ failed to resolve

ZTL-UwU avatar Feb 23 '24 14:02 ZTL-UwU

same problem with me!

bun install v1.1.0 (5903a614) Enqueue package manifest for download: @types/bun 🔍 Resolving [1/1] [PackageManager] waiting for 1 tasks Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

aihuasxy avatar Apr 02 '24 07:04 aihuasxy

the same goes for Clash users:

bun install v1.1.0 (5903a614) info: cannot move files from tempdir: RenameAcrossMountPoints, using fallback Enqueue package manifest for download: @types/bun 🔍 Resolving [1/1] [PackageManager] waiting for 1 tasks Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

🔍 @types/bun [6/6] error: Syscall downloading package manifest @types/bun Enqueue package manifest for download: typescript Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

🔍 typescript [12/12] error: Syscall downloading package manifest typescript warn: Syscall downloading package manifest @types/bun

warn: Syscall downloading package manifest @types/bun

warn: Syscall downloading package manifest @types/bun

warn: Syscall downloading package manifest @types/bun

warn: Syscall downloading package manifest @types/bun

warn: Syscall downloading package manifest typescript

warn: Syscall downloading package manifest typescript

warn: Syscall downloading package manifest typescript

warn: Syscall downloading package manifest typescript

warn: Syscall downloading package manifest typescript Clean lockfile: 1 packages - 1 packages in 57.4us error: @types/bun@latest failed to resolve

thatsgolden avatar Apr 03 '24 13:04 thatsgolden

I have the same problem. Http_proxy was settled. And I need to have it settled, are under corporate proxy, cannot do without it.

manudss avatar Apr 04 '24 08:04 manudss

same issue

bun install v1.1.2 (c8d072c2)
  🔍 vite [11/12]
error: Syscall downloading package manifest vite

zhuweiyou avatar Apr 07 '24 02:04 zhuweiyou

same issue


bun install v1.1.2 (c8d072c2)

  🔍 vite [11/12]

error: Syscall downloading package manifest vite

Bro, replying "same issue" does not help anything; it doesn't provide any useful information to fix the bug. You can just press the emoji ("reaction") button. 🙂

guyutongxue avatar Apr 07 '24 04:04 guyutongxue

I would like to help pinpoint this issue, but I'm unsure where to start. I'm ready to compile 'bun' locally and then debug it, but since the compilation process for 'bun' also requires 'bun install', it becomes a chicken-and-egg problem.

aihuasxy avatar Apr 09 '24 08:04 aihuasxy

I would like to help pinpoint this issue, but I'm unsure where to start. I'm ready to compile 'bun' locally and then debug it, but since the compilation process for 'bun' also requires 'bun install', it becomes a chicken-and-egg problem.

I believe you can run the bun install script for bun itself without setting the proxy.

ZTL-UwU avatar Apr 09 '24 08:04 ZTL-UwU

I would like to help pinpoint this issue, but I'm unsure where to start. I'm ready to compile 'bun' locally and then debug it, but since the compilation process for 'bun' also requires 'bun install', it becomes a chicken-and-egg problem.

I believe you can run the bun install script for bun itself without setting the proxy.

(base) PS E:\github\bun> bun install bun install v1.1.2 (c8d072c2) 🔍 Resolving... error: Syscall downloading tarball [email protected] 🔍 Resolving... error: Syscall downloading tarball [email protected] 🔍 Resolving... error: Syscall downloading tarball @eslint/[email protected] 🔍 Resolving... error: Syscall downloading tarball [email protected] . . .

aihuasxy avatar Apr 09 '24 09:04 aihuasxy

Is $Env:http_proxy present in your Powershell's $PROFILE?

ZTL-UwU avatar Apr 09 '24 09:04 ZTL-UwU

Is $Env:http_proxy present in your Powershell's $PROFILE?

Yes http_proxy and https_proxy in both $Env and file $PROFILE. BTW: I'm using the company network, which has a firewall, and all access needs to go through the proxy.

aihuasxy avatar Apr 09 '24 11:04 aihuasxy

https://github.com/oven-sh/bun/blob/7b5065c1c9d46d838d23f0279a508d0bae3357bd/src/http.zig#L2632-L2644

The problem is with proxy.ssl.handshake(), which throws an error.Syscall.

ZTL-UwU avatar Apr 14 '24 03:04 ZTL-UwU