bug: Old Bun 1.3.3 fetch aborts requests after 300 s idle
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
- #5043 來自 @yulman2207 —— 已關閉,未合併
評估
- 難度
- 4/5
- 預估耗時
- 1-2 天
- 新手友好度
- 53/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- bun, docker, typescript
研究方向
Start with packages/core/src/v3/schemas/build.ts to see how build runtime values are defined, then trace Bun image selection in packages/cli-v3/src/deploy/buildImage.ts and image names in base-images/images.json. Check how Node runtime versions are mapped as a guide. Done when a supported runtime can select a published Bun image and the deployment build uses it.
由索引模型根據 Issue 內容生成。
描述
Provide environment information
System:
OS: macOS 27.0.1
CPU: (10) arm64 Apple M2 Pro
Memory: 6.42 GB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.19.0 - /opt/homebrew/bin/node
npm: 11.17.0 - /opt/homebrew/bin/npm
bun: 1.4.3 - /Users/be/.bun/bin/bun
Deployed on Trigger.dev Cloud (prod, eu-central-1), trigger.dev CLI / @trigger.dev/sdk 4.6.3, trigger.config.ts runtime: "bun".
The local machine is not involved: the failure happens in the deployed image (Bun 1.3.3).
Describe the bug
runtime: "bun" always deploys on triggerdotdev/bun:1.3-node20-bookworm, which ships Bun 1.3.3. On Bun 1.3.x, fetch aborts any request that receives no bytes for 300 seconds, throwing TimeoutError: The operation timed out. A per-request timeout or AbortSignal longer than 300 s doesn't help.
Long, non-streaming LLM calls (for example Vertex AI generateContent with large structured outputs) send nothing until they finish, so on Trigger.dev they fail at exactly 5:00.
What we see:
- A task on
runtime: "bun"(trigger.dev 4.6.3) makes one AI SDKgenerateTextcall to Vertex AI withtimeout: 360_000. - The run fails exactly 300 s after the call starts with
TimeoutError: The operation timed out.That's Bun's message; Node's equivalent reads "The operation was aborted due to timeout". - The same request completes under Bun 1.4.x.
Expected: a supported way to run on a Bun release without this limit. You already publish triggerdotdev/bun:1.4-bookworm (Bun 1.4.2), but the CLI can't select it.
Reproduction repo
No repository needed: the reproduction is a single self-contained Bun script with no dependencies (see "To reproduce"). It runs a local server, so no network or Trigger.dev account is required.
To reproduce
Save as bun-timeout.ts and run bun run bun-timeout.ts with each Bun version. It takes about 5.5 minutes.
const server = Bun.serve({
port: 0,
idleTimeout: 0,
fetch(req) {
if (new URL(req.url).pathname === "/silent") {
// headers and body only after 330 s
return new Promise((resolve) => setTimeout(() => resolve(new Response("done")), 330_000));
}
// headers immediately, then one byte every 10 s for 330 s
let n = 0;
return new Response(
new ReadableStream({
async pull(controller) {
await Bun.sleep(10_000);
controller.enqueue(new TextEncoder().encode("."));
if (++n >= 33) controller.close();
},
}),
);
},
});
const t0 = Date.now();
const run = async (path: string, init?: object) => {
try {
await (await fetch(`http://localhost:${server.port}${path}`, init)).text();
console.log(Bun.version, path, JSON.stringify(init ?? {}), "ok after", (Date.now() - t0) / 1000, "s");
} catch (e: any) {
console.log(Bun.version, path, JSON.stringify(init ?? {}), "failed after", (Date.now() - t0) / 1000, "s:", e?.name, e?.message);
}
};
await Promise.all([run("/silent"), run("/trickle"), run("/silent", { timeout: false })]);
server.stop(true);
Results with the official @oven/bun-darwin-aarch64 builds:
| Bun | silent 330 s | trickle 330 s | silent + timeout: false |
|---|---|---|---|
1.3.3 (current runtime: "bun" image) |
failed at 300.0 s, TimeoutError: The operation timed out. |
ok | ok |
1.3.14 (bun:1.3-bookworm) |
failed at 300.0 s | ok | ok |
1.4.2 (bun:1.4-bookworm) |
ok | ok | ok |
| 1.4.3 | ok | ok | ok |
The limit is an idle timeout: the response that trickles a byte every 10 s survives.
In a deployed task, any fetch that waits more than 300 s for the first byte fails the same way.
Suggested fix
Make Bun 1.4 selectable, the same way Node majors are. For example runtime: "bun-1.4" (and "bun-1.3"), mapped to the already-published triggerdotdev/bun:1.4-bookworm / bun:1.3-bookworm images. Or move runtime: "bun" to a current Bun release.
Where the version comes from (checked on v4.7.4 and main as of 2026-10-20):
packages/core/src/v3/schemas/build.ts:BuildRuntime = z.enum(["node", "node-22", "node-24", "node-26", "bun"]), so there's no way to choose a Bun version.packages/cli-v3/src/deploy/buildImage.ts:BASE_IMAGE.bun/BUILD_IMAGE.bun→triggerdotdev/bun:1.3-node20-bookworm(-build).base-images/images.json: that image copiesoven/bun:1.3.3-slim. The same file already publishesbun:1.3-bookworm(oven/bun:1.3.14-slim) andbun:1.4-bookworm(oven/bun:1.4.2-slim).
#5003 (build.image.base overrides) would allow a workaround, but a supported runtime value would keep projects on images you publish and test.
Additional information
Workaround: passing Bun's non-standard timeout: false to fetch removes the cap. But it has to reach every HTTP client a task uses (AI SDKs, Google auth), and it also removes the only bound for calls that set no timeout of their own.
In production, every failed run of one of certain tasks over two months died at exactly 300s on this error. Another task survived only because its retry happened to finish under 300s.
- 主要語言
- TypeScript
- 星號
- 16.5k
- 分支
- 1.5k
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 17
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
triggerdotdev/trigger.dev 的其他 Issue
-
bug: retry.fetch ignores the caller's abort signal and retries aborted requests可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
triggerdotdev/trigger.dev#5116 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug: Chat transport crashes on Safari < 17.4: AbortSignal.any is not a function可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 83/100
triggerdotdev/trigger.dev#5098 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug: Side menu items lose their active state on detail pages可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
triggerdotdev/trigger.dev#5088 ·
維護者通常 1 天內回覆
-
bug: RBAC loader logs "plugin found but failed to load" when @triggerdotdev/plugins is simply not installed可能重新可做 @itsfaryal 於 17 天前認領,目前沒有進行中的 PR。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
triggerdotdev/trigger.dev#5083 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 83/100
triggerdotdev/trigger.dev#5072 · 1 則留言 ·
維護者通常 1 天內回覆
查看 triggerdotdev/trigger.dev 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug platform-android
難度 2/5 1-3 小時 新手友好度 68/100
Termix-SSH/Mobile#146 · 1 則留言 ·
維護者通常 2 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 66/100
devswha/herdr-web-ui#3875 ·
-
難度 1/5 1 小時以內 新手友好度 88/100
-
area: runtime chore cli consistency dependencies developer-experience difficulty: easy discovery documentation enhancement good first issue help wanted hygiene json-output packaging priority: P3 tests version
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆