t3code icon indicating copy to clipboard operation
t3code copied to clipboard

fix(server): surface cloudflared FTL/PNC relay logs as warnings, not debug

Open arhxam opened this issue 4 months ago • 2 comments

What Changed

classifyRelayClientOutput (apps/server/src/cloud/ManagedEndpointRuntime.ts) now treats the cloudflared FTL and PNC zerolog level tokens as warnings, alongside the existing ERR/WRN. Extended the existing classifier test.

Why

The function classifies relay-connector (cloudflared) output into connected / warning / debug severities. It only matched ERR and WRN, so FTL (fatal) and PNC (panic) — both strictly more severe than ERR — fell through to debug, the quietest level. A fatal connector failure (e.g. FTL Cannot determine default origin certificate path, or a runtime panic that takes T3 Connect down) was therefore logged at debug and effectively hidden exactly when someone is diagnosing why the relay went offline.

Adding FTL/PNC to the warning set makes the most severe relay failures surface at least as loudly as ordinary errors. The added assertions fail before this change and pass after.

Checklist

  • [x] This PR is small and focused
  • [x] I explained what changed and why
  • [x] No UI changes

[!NOTE] Low Risk Narrow logging-severity tweak in relay output classification with matching unit tests; no auth, data, or runtime behavior changes beyond log visibility.

Overview Relay log classification for cloudflared output now treats zerolog FTL (fatal) and PNC (panic) like ERR/WRN, so those lines are logged via logWarning instead of logDebug.

Before this change, the most severe connector failures (certificate path fatals, runtime panics) were effectively hidden at debug level when diagnosing relay outages. Tests assert FTL and PNC map to warning.

Reviewed by Cursor Bugbot for commit f1add90c145a585fb054a4505be77ec2c01989fc. Bugbot is set up for automated code reviews on this repo. Configure here.

[!NOTE]

Surface cloudflared FTL and PNC relay logs as warnings instead of debug

Expands the regex in classifyRelayClientOutput in ManagedEndpointRuntime.ts from /\b(?:ERR|WRN)\b/u to /\b(?:ERR|WRN|FTL|PNC)\b/u, so zerolog fatal and panic level tokens are treated as warnings rather than debug output.

Macroscope summarized f1add90.

arhxam avatar Jul 31 '26 06:07 arhxam

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9568c31d-a857-4aea-9016-899ebc690b0d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • [ ] 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar Jul 31 '26 06:07 coderabbitai[bot]

Approvability

Verdict: Approved f1add90

Simple bug fix that adds FTL (fatal) and PNC (panic) log tokens to the cloudflared output classifier regex, ensuring severe logs surface as warnings instead of being hidden at debug level. The change is minimal, well-tested, and only affects log visibility.

You can customize Macroscope's approvability policy. Learn more.

macroscopeapp[bot] avatar Jul 31 '26 06:07 macroscopeapp[bot]