Skip to content

debug-files upload fails with "TypeError: fetch failed" (HTTP/2 stream resets) #2201

Closed

Description

@tustanivsky

sentry debug-files upload from the standalone binaries fails at random with:

Unexpected error: TypeError: fetch failed

In the Sentry Unreal plugin CI (getsentry/sentry-unreal#1680), about half of the Windows uploads fail. Legacy sentry-cli does not fail this way.

Cause

The [email protected] binaries use Node 26. Its fetch (undici 8) uses HTTP/2 by default. The CLI sends 8 chunk uploads (up to 32 MiB each) at the same time, so they share one HTTP/2 connection. On that connection, sentry.io resets all upload streams except the last one with ENHANCE_YOUR_CALM. Retries hit the same reset, and the error reaches the user without its cause.

The same test with plain node:http2:

Protocol Uploads at once Result
HTTP/2, 1 connection 1 1/1 OK
HTTP/2, 1 connection 8 1/8 OK
HTTP/1.1, 8 connections 8 8/8 OK

Legacy sentry-cli uses HTTP/1.1 with one connection per upload.

To reproduce

Upload a debug file with about 200 MiB of new random data with the 0.49.0 binary. The upload fails after about 70 s.

Possible fix

  • Send chunk uploads over HTTP/1.1 (allowH2: false), as legacy sentry-cli does.
  • Show the network cause in the error.

A tested fix is on branch tustanivsky/toolkit:fix/cli-chunk-upload-h2-calm. With it, the same upload succeeds in about 10 s with no retries.

Activity

  1. sentry-junior commented on Nov 12, 2026

    @sentry-junior
    Contributor

    Thanks a lot @tustanivsky for the detailed report and the tested fix. The node:http2 comparison table made the cause clear right away.

    Your two commits are on fix/cli-chunk-upload-http1, rebased on main, and you're still the author. I added one commit that fixes the code comments. Node 24 (undici 7.30.1) also registers undici.globalDispatcher.2, so it takes the HTTP/1.1 dispatcher path too. That's harmless, since Node 24 already uses HTTP/1.1. I checked the fix against a local HTTP/2 server with 8 parallel POSTs. On Node 26.13.1 and on Node 24.22.1, all 8 went over HTTP/1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions