Repository navigation
Description
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?
- set proxy:
export http_proxy=<url>; export https_proxy=<url> - run:
bun installorbun 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 buildWhen 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.
Additional versions tested
🐛 : The bug is still present.
v1.2.5: 🐛v1.2.6: 🐛v1.2.7: 🐛v1.2.8: 🐛v1.2.9: 🐛v1.2.10: 🐛v1.2.11: 🐛v1.2.12: 🐛v1.2.13: 🐛
Activity
bmakan commentedon Mar 12, 2025
I've tried the latest
oven/bun:1.2.5-alpineimage and the issue persists.bmakan commentedon Mar 26, 2025
The issue persists with bun v1.2.6. 🔥
Although now it just hangs. I left it running while I took a bite, and came back to see it was stuck at bun install for over half an hour.
I managed to build the image locally on Windows laptop in the WSL by removing the
http_proxyvariables. It's possible it went through some proxies at other levels of the network because I am still using company VPN.gnarroway-bullish commentedon Mar 31, 2025
Workaround is to do
bun install || bun install || bun install || bun install || bun installThis has the side effect of making bun the slowest package manager I've ever used (30 minutes to install a small project), but once it works, it works fast.
Edit: This regression was introduced in 1.1.26 onwards
danriedl commentedon Aug 26, 2025
still does not work for me on
1.2.21bmakan commentedon Aug 26, 2025
While the proxy fix worked for me, there's still another issue related to cache. I always install/update dependencies with
--no-cacheotherwise it just gets stuck forever.tiann commentedon Dec 4, 2025
still does not work for me on 1.3.3, add
--no-cachecan fix the issue.snowfluke commentedon Dec 23, 2025
@tiann thanks, it worked
fix(http): 304 Not Modified through proxy tunnel hangs indefinitely (#…
lushangkan commentedon Mar 21, 2026
It worked.
fix(http): 304 Not Modified through proxy tunnel hangs indefinitely (o…
fix(http): 304 Not Modified through proxy tunnel hangs indefinitely (o…