Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Send swallowed auth/migration DB errors to Sentry, and stop reporting routine 4xx

Aperta
#554 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
typescript

Direzione di ricerca

Inizia con l’hook onError in platform/src/server.ts:30-32, poi esamina gli errori ignorati in server.ts:48 e in instance-auth.ts:139 e :275. Leggi gli usi esistenti di captureException in instance-auth.ts e l’implementazione in platform/src/util/sentry.ts. Il lavoro è completato quando tutti e tre gli errori DB vengono catturati, gli errori 4xx di routine vengono ignorati e i log e le risposte HTTP esistenti rimangono invariati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug monitoring platform

Two related problems with how we report errors to Sentry.

First, three database failures in the client-auth path get logged with console.error and then forgotten. They never reach Sentry, so we're blind to them in production.

Second, the Elysia onError hook sends every error to Sentry, including routine 4xx like favicon bots hitting NOT_FOUND. That noise buries the errors we actually care about.

They sit in overlapping code, so it's easier to fix them together.

1. Capture the three swallowed DB errors. Each one currently console.errors and moves on:

  • platform/src/server.ts:48 — migration run failure (runMigrations()).
  • platform/src/auth/instance-auth.ts:139 — startup DB-probe (reachability) failure; auth degrades to the shape-checked forward path.
  • platform/src/auth/instance-auth.ts:275 — runtime client-lookup failure; request fails closed.

Each of these needs an explicit captureException(err, …) next to the log it already writes. captureException is already imported in instance-auth.ts:7 and used elsewhere in that file (lines 158, 251, 312), so those two sites are just inconsistent with the rest of it. server.ts needs the import adding (import { captureException } from "./util/sentry").

2. Skip 4xx in the onError hook. Request errors only reach Sentry through the onError hook at platform/src/server.ts:30-32, and it calls captureException(error) for everything. Add a status check so we only capture 5xx and unexpected errors, and skip the routine 4xx like NOT_FOUND. Elysia hands us the error code and status on the onError context, so the guard lives right there in the hook.

Sentry is wired in platform/src/util/sentry.ts (captureException is a no-op when SENTRY_DSN is unset) and initialised from platform/src/index.ts:4.

Acceptance criteria
  • Migration failure at platform/src/server.ts:48 calls captureException, with the import added to server.ts.
  • Startup DB-probe failure at platform/src/auth/instance-auth.ts:139 calls captureException.
  • Runtime client-lookup failure at platform/src/auth/instance-auth.ts:275 calls captureException.
  • The onError hook (platform/src/server.ts:30-32) only captures 5xx/unexpected errors; 4xx (e.g. NOT_FOUND) is skipped.
  • No behaviour change to the HTTP responses themselves — onError still returns nothing so Elysia produces its normal error body/status.
  • Existing log lines retained; Sentry capture is additive.
Lingua principale
Jupyter Notebook
Stelle
5
Fork
10
Merge medio
2g 12h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenFn/apollo

Tutte le issue di OpenFn/apollo

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.