trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: an object-store 404 with an empty reason phrase makes a missing transcript a 502 instead of a 404

Open breken-ai opened this issue 2 months ago • 2 comments

Provide environment information

Not environment-specific: found in the webapp source at main @ c2b7a72180 and reproduced with the webapp's own Vitest suite (macOS arm64, pnpm).

Describe the bug

A missing transcript can return 502 instead of 404 when the object store's 404 response has an empty reason phrase.

  • Aws4FetchClient.getObjectResponse (apps/webapp/app/v3/objectStoreClient.server.ts:135-141) throws an error built only from response.statusText and discards response.status:

    throw new Error(`Failed to download from object store: ${response.statusText}`);
    
  • isTranscriptNotFound (apps/webapp/app/services/realtime/transcriptDownload.server.ts:46-54) recognizes this adapter's missing object only by matching the message against /^Failed to download(?: range)? from object store: Not Found$/.

A valid HTTP/1.1 404 with no reason phrase gives the message Failed to download from object store: . It isn't classified as not found, so the route answers with a download failure (502).

Expected: a 404 from the object store is recognized by its status code, whatever the reason phrase says.

Reproduction repo

N/A (test against this repo, below)

To reproduce

In transcriptDownload.server.test.ts, start a local TCP server that replies HTTP/1.1 404 \r\nContent-Length: 0\r\n\r\n. Point ObjectStoreClient.create({ baseUrl: "http://127.0.0.1:<port>", service: "s3", ... }) at it, then:

await expect(client.getObjectResponse(key)).rejects.toSatisfy(isTranscriptNotFound);

On main this fails, because the error message is Failed to download from object store: and it isn't recognized.

Additional information

A fix with this regression test and a .server-changes note is ready locally:

  • the thrown error carries status: 404;
  • isTranscriptNotFound checks the status first.

The transcript suite (8 passed), oxfmt, oxlint and webapp typecheck pass. I'll open it as a draft PR with fixes #<this> once the account is vouched.

Prepared with AI assistance (Claude) from the breken-ai account.

breken-ai avatar Sep 26 '26 21:09 breken-ai

Hi Trigger.dev team,

I’d like to request a vouch so I can contribute to the repository.

I’ve prepared a focused fix for #4984, where an object-store 404 with an empty reason phrase causes a missing transcript to return 502 instead of 404. The change preserves the numeric HTTP status, updates the missing-transcript classification, adds a regression test using a raw HTTP response, and includes a server changelog entry.

My PR was automatically closed because I wasn’t vouched. I’ve read the contributing guide and understand that future PRs must be opened as drafts, address one issue only, and pass the required tests and CI checks.

A little about me: [briefly describe your background and relationship to Trigger.dev—customer, self-hoster, developer, or contributor]. Relevant work: [links to your GitHub profile, projects, or previous contributions].

Issue: https://github.com/triggerdotdev/trigger.dev/issues/4984
Closed PR: https://github.com/triggerdotdev/trigger.dev/pull/5011

I’d appreciate being considered for contributor access. I’m also happy to wait for maintainer confirmation before reopening or resubmitting the change.

Thank you!

shayomi avatar Oct 08 '26 20:10 shayomi

Hi Trigger.dev team,

I'd like to request a vouch so I can start contributing to Trigger.dev.

I'm interested in contributing meaningful bug fixes and improving the reliability of the project. I'm comfortable working with Python and am building my experience with Git, GitHub, and open-source development.

I've been exploring the repository's open issues and reading the contributing guidelines to understand the project's workflow before submitting a contribution.

GitHub profile: https://github.com/Nimisha987

Relevant projects or contributions: [links to your projects or previous contributions]

I'd appreciate the opportunity to contribute. I'm happy to start with a small, well-scoped issue and follow the project's contribution requirements.

Thank you for your time!

Nimisha987 avatar Oct 22 '26 15:10 Nimisha987