Skip to content

appview: log the cause, repo and seq of per-event relay-firehose errors - #262

Merged
DGaffney merged 2 commits into
mainfrom
fix/relay-firehose-log-cause
Nov 30, 2026
Merged

DGaffney merged 2 commits into
mainfrom
fix/relay-firehose-log-cause

Conversation

@DGaffney

Copy link
Copy Markdown
Contributor

Why

On 2026-11-30 the AppView ran out of Node heap (~3.9 GB) seven times in 17 hours, in both production and dev, and exhausted Railway's 10 restart retries. The acceleration from a weekly OOM to one every ~2.5h coincided with a flood of this log line, dozens per second:

relay-firehose error: error in parsing and authenticating firehose event

That message is the generic wrapper @atproto/sync puts around every parse/auth failure. The real failure is on err.cause, and the raw event is on err.event, but we logged only err.message — so the log cannot say whether these are bad signatures, failed DID lookups, or something else, or which repos they come from.

What

  • describeRelayError(err) builds one line: message, cause=<name>: <message>, and for parse errors repo=<did> seq=<n>.
  • The per-event onError handler logs that instead of err.message.

No behaviour change beyond the log line. Subscription-level errors still re-throw into the supervised reconnect as before.

Not in this PR

This does not fix the leak. It is the diagnostic needed to find it. Log volume per line grows, at the same line count.

Testing

  • vitest run src/indexer/relay-firehose.test.ts — 6 passed (3 new)
  • tsc -p . --noEmit in packages/appview — clean

🤖 Generated with Claude Code

@atproto/sync wraps every parse/auth failure in a generic 'error in parsing
and authenticating firehose event'. We logged only err.message, so when that
line flooded the AppView log on 2026-11-30 (alongside a heap OOM every ~2.5h)
there was no way to tell what was failing or for which repos.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to co/core / cocore-pr-262 November 30, 2026 17:38 Destroyed
@railway-app

railway-app Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the cocore-pr-262 environment in co/core

Service Status Web Updated
Client ✅ Success (View Logs) Web Nov 30, 2026 at 5:52 pm UTC
AppView ✅ Success (View Logs) Web Nov 30, 2026 at 5:51 pm UTC
Advisor ✅ Success (View Logs) Web Nov 30, 2026 at 5:51 pm UTC
4 services not affected by this PR
  • cocore-mdm-gateway
  • Postgres
  • cocore-nanomdm
  • cocore-step-ca

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🛠️ Provider build (macOS arm64) — menu-bar app + CLI

Built from 1f29072. The tarball bundles cocore.app (the menu-bar/tray app) plus the bare cocore CLI.

🔌 Pre-wired to this PR's stack — the app defaults to https://client-cocore-pr-262.up.railway.app + wss://advisor-cocore-pr-262.up.railway.app/v1/agent (overridable in Settings → Network).

⬇️ cocore-mac-arm64-pr262-1f29072.tar.gz

(GitHub artifact — requires being signed in to this repo. The zip contains the .tar.gz + its .sha256.)

tar -xzf cocore-mac-arm64*.tar.gz && cd cocore-mac-arm64
./install.sh   # installs cocore.app to /Applications + the CLI, launches the tray

⚠️ Ad-hoc signed (not notarized) — but install.sh clears the Gatekeeper quarantine for you, so it launches without the "unidentified developer" block. (If you drag the .app in by hand instead, run xattr -dr com.apple.quarantine /Applications/cocore.app yourself first.)

CLI only? It's wired to this PR's stack too:

./bin/cocore agent pair  --console https://client-cocore-pr-262.up.railway.app
./bin/cocore agent serve --advisor wss://advisor-cocore-pr-262.up.railway.app/v1/agent

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to co/core / cocore-pr-262 November 30, 2026 17:50 Destroyed
@DGaffney
DGaffney merged commit bde0220 into main Nov 30, 2026
10 checks passed
@DGaffney
DGaffney deleted the fix/relay-firehose-log-cause branch November 30, 2026 18:37

This branch was successfully deployed

No deployments
co/core / cocore-pr-262 — 9b69a111 Deployed Nov 30, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant