Title: bug: Old Bun 1.3.3 fetch aborts requests after 300 s idle · Issue #5041 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: bug: Old Bun 1.3.3 fetch aborts requests after 300 s idle · Issue #5041 · triggerdotdev/trigger.dev
X Title: bug: Old Bun 1.3.3 fetch aborts requests after 300 s idle · Issue #5041 · triggerdotdev/trigger.dev
Description: 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 - /Us...
Open Graph Description: 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 ...
X Description: 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 ...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/5041
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: Old Bun 1.3.3 fetch aborts requests after 300 s idle","articleBody":"### Provide environment information\n\n System:\n OS: macOS 27.0.1\n CPU: (10) arm64 Apple M2 Pro\n Memory: 6.42 GB / 16.00 GB\n Shell: 5.9 - /bin/zsh\n Binaries:\n Node: 24.19.0 - /opt/homebrew/bin/node\n npm: 11.17.0 - /opt/homebrew/bin/npm\n bun: 1.4.3 - /Users/be/.bun/bin/bun\n\nDeployed on Trigger.dev Cloud (prod, eu-central-1), trigger.dev CLI / @trigger.dev/sdk 4.6.3, trigger.config.ts `runtime: \"bun\"`.\nThe local machine is not involved: the failure happens in the deployed image (Bun 1.3.3).\n\n\n### Describe the bug\n\n`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.\n\nLong, 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.\n\nWhat we see:\n- A task on `runtime: \"bun\"` (trigger.dev 4.6.3) makes one AI SDK `generateText` call to Vertex AI with `timeout: 360_000`.\n- 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\".\n- The same request completes under Bun 1.4.x.\n\nExpected: 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.\n\n\n### Reproduction repo\n\nNo 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.\n\n### To reproduce\n\nSave as `bun-timeout.ts` and run `bun run bun-timeout.ts` with each Bun version. It takes about 5.5 minutes.\n\n```ts\nconst server = Bun.serve({\n port: 0,\n idleTimeout: 0,\n fetch(req) {\n if (new URL(req.url).pathname === \"/silent\") {\n // headers and body only after 330 s\n return new Promise((resolve) => setTimeout(() => resolve(new Response(\"done\")), 330_000));\n }\n // headers immediately, then one byte every 10 s for 330 s\n let n = 0;\n return new Response(\n new ReadableStream({\n async pull(controller) {\n await Bun.sleep(10_000);\n controller.enqueue(new TextEncoder().encode(\".\"));\n if (++n >= 33) controller.close();\n },\n }),\n );\n },\n});\nconst t0 = Date.now();\nconst run = async (path: string, init?: object) => {\n try {\n await (await fetch(`http://localhost:${server.port}${path}`, init)).text();\n console.log(Bun.version, path, JSON.stringify(init ?? {}), \"ok after\", (Date.now() - t0) / 1000, \"s\");\n } catch (e: any) {\n console.log(Bun.version, path, JSON.stringify(init ?? {}), \"failed after\", (Date.now() - t0) / 1000, \"s:\", e?.name, e?.message);\n }\n};\nawait Promise.all([run(\"/silent\"), run(\"/trickle\"), run(\"/silent\", { timeout: false })]);\nserver.stop(true);\n```\n\nResults with the official `@oven/bun-darwin-aarch64` builds:\n\n| Bun | silent 330 s | trickle 330 s | silent + `timeout: false` |\n| --- | --- | --- | --- |\n| 1.3.3 (current `runtime: \"bun\"` image) | **failed at 300.0 s**, `TimeoutError: The operation timed out.` | ok | ok |\n| 1.3.14 (`bun:1.3-bookworm`) | **failed at 300.0 s** | ok | ok |\n| 1.4.2 (`bun:1.4-bookworm`) | ok | ok | ok |\n| 1.4.3 | ok | ok | ok |\n\nThe limit is an idle timeout: the response that trickles a byte every 10 s survives.\n\nIn a deployed task, any `fetch` that waits more than 300 s for the first byte fails the same way.\n\n\n### Suggested fix\n\nMake 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.\n\nWhere the version comes from (checked on v4.7.4 and `main` as of 2026-10-20):\n- `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.\n- `packages/cli-v3/src/deploy/buildImage.ts`: `BASE_IMAGE.bun` / `BUILD_IMAGE.bun` → `triggerdotdev/bun:1.3-node20-bookworm(-build)`.\n- `base-images/images.json`: that image copies `oven/bun:1.3.3-slim`. The same file already publishes `bun:1.3-bookworm` (`oven/bun:1.3.14-slim`) and `bun:1.4-bookworm` (`oven/bun:1.4.2-slim`).\n\n#5003 (`build.image.base` overrides) would allow a workaround, but a supported runtime value would keep projects on images you publish and test.\n\n\n### Additional information\n\nWorkaround: 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.\n\nIn 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.\n","author":{"url":"https://github.com/Trosterud","@type":"Person","name":"Trosterud"},"datePublished":"2026-10-20T10:18:32Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/5041"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:36ddf3ba-988c-f549-10bd-1612fed72373 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCF2:358701:6003EFE:7F57278:6AFAD87B |
| html-safe-nonce | 55e386865c9ba7efd0e1a336600fac7b8aeba7979d850d738cb527fc7e2a853f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0YyOjM1ODcwMTo2MDAzRUZFOjdGNTcyNzg6NkFGQUQ4N0IiLCJ2aXNpdG9yX2lkIjoiMjc5MDYyOTAyMjExMzY1MDgxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7f4355e10aa039a0268cdf0232fe691c93fb1aae252e87fdcc02673cd992ce94 |
| hovercard-subject-tag | issue:5939963356 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/5041/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ff35c75348376c072b704915ecb490014e59c4af97cb0570331f68618814eedd/triggerdotdev/trigger.dev/issues/5041 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ff35c75348376c072b704915ecb490014e59c4af97cb0570331f68618814eedd/triggerdotdev/trigger.dev/issues/5041 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Trosterud |
| hostname | github.com |
| expected-hostname | github.com |
| None | 02f4c00e74911c7cd779fc232c3130cee49eb39fd0ed4bfe3eea3b82c7c18084 |
| turbo-cache-control | no-preview |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 33c41e9d150e44415272934d676dc63c57d89c3b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width