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

bun install/update behind proxy #17793

Open
bmakan opened this issue Feb 28, 2025 · 0 comments
Open

bun install/update behind proxy #17793

bmakan opened this issue Feb 28, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@bmakan
Copy link

bmakan commented Feb 28, 2025

What version of Bun is running?

1.2.4+fd9a5ea66

What platform is your computer?

Linux 5.15.0-124-generic x86_64 x86_64

What steps can reproduce the bug?

  1. set proxy: export http_proxy=<url>; export https_proxy=<url>
  2. run: bun install or bun update

What is the expected behavior?

Installation and/or update runs smoothly.

What do you see instead?

Randomly, the process just hangs at "Resolving..." or "Installing...". Once the cache is built in ~/.bun/install/cache, the process is fast and without any issues. But then bun update --latest may hang again due to downloading stuff.

This is especially problematic in a docker container. When I am trying to build an image with bun, the installation step always errors out with following error:

 => CANCELED [client 4/6] RUN bun install                                                                                     306.1s
------
 > [docs 4/6] RUN bun install:
2.822 bun install v1.2.4 (fd9a5ea6)
303.0 error: ShortRead decompressing "debug" to ".1e796befefe3ff75-00000442.debug"
303.0
303.0 error: InstallFailed extracting tarball from debug
303.0
303.0 error: ShortRead decompressing "algoliasearch" to ".bfec4dfdffac6ff5-00000443.algoliasearch"
303.0
303.0 error: InstallFailed extracting tarball from algoliasearch
303.0
303.0 error: ShortRead decompressing "image-size" to ".de2e4dddff37f67b-00000444.image-size"
303.0
303.0 error: InstallFailed extracting tarball from image-size
------
Dockerfile:33
--------------------
  31 |
  32 |     COPY docs/package.json docs/bun.lock ./
  33 | >>> RUN bun install
  34 |
  35 |     COPY docs .
--------------------
ERROR: failed to solve: process "/bin/sh -c bun install" did not complete successfully: exit code: 1
exit status 1
Image build failed!

My Dockerfile:

FROM oven/bun AS client

ARG proxy=<url>

ENV HTTP_PROXY=${proxy}
ENV HTTPS_PROXY=${proxy}

COPY client/package.json client/bun.lock ./
RUN bun install

COPY client .

RUN bun run build

When I run the exact same docker container interactively, I am able to install dependencies. But again, there's the occasional hanging which I need to kill (Ctrl + C) and run again.

I use the exact same proxy for npm, pip, apt, etc. These other tools don't have such problems.

Additional information

I have been struggling with these random "hangings" for months. I periodically check and install new bun versions, but the problem persists. Recently I attempted to replace my node-based docker build with bun to have the same build environment for production and development, which lead me to opening this issue.

@bmakan bmakan added bug Something isn't working needs triage labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant