authorgravatar for 132888838+arhxam@users.noreply.github.comArham Amin <132888838+arhxam@users.noreply.github.com> 2026-08-02 01:40:25+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-01 16:10:25-04:00
log5192f777fe54c2a2a359f6c25ecf5fbde46d49b0
treec2e9c4e078a6b4da5511cfeeac604533f96f7368
parent283c7ac4baafd96711872d4fe49e3851a8ecaa65
signature Signed by PGP key B5690EEEBB952194

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

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

2 files changed, 13 insertions(+), 1 deletions(-)

apps/server/src/cloud/ManagedEndpointRuntime.test.ts+9
...@@ -96,6 +96,15 @@ describe("CloudManagedEndpointRuntime", () => {...@@ -96,6 +96,15 @@ describe("CloudManagedEndpointRuntime", () => {
96 "2026-06-17T02:00:00Z INF Starting metrics server",96 "2026-06-17T02:00:00Z INF Starting metrics server",
97 ),97 ),
98 ).toBe("debug");98 ).toBe("debug");
99 // FTL (fatal) and PNC (panic) are more severe than ERR and must surface.
100 expect(
101 ManagedEndpointRuntime.classifyRelayClientOutput(
102 "2026-06-17T02:00:00Z FTL Cannot determine default origin certificate path",
103 ),
104 ).toBe("warning");
105 expect(
106 ManagedEndpointRuntime.classifyRelayClientOutput("2026-06-17T02:00:00Z PNC runtime panic"),
107 ).toBe("warning");
99 });108 });
100109
101 it.effect("starts, deduplicates, rotates, and stops the Cloudflare connector", () =>110 it.effect("starts, deduplicates, rotates, and stops the Cloudflare connector", () =>
apps/server/src/cloud/ManagedEndpointRuntime.ts+4-1
...@@ -72,7 +72,10 @@ export function classifyRelayClientOutput(line: string): "connected" | "warning"...@@ -72,7 +72,10 @@ export function classifyRelayClientOutput(line: string): "connected" | "warning"
72 if (/\bRegistered tunnel connection\b/iu.test(line)) {72 if (/\bRegistered tunnel connection\b/iu.test(line)) {
73 return "connected";73 return "connected";
74 }74 }
75 return /\b(?:ERR|WRN)\b/u.test(line) ? "warning" : "debug";75 // cloudflared uses zerolog level tokens. FTL (fatal) and PNC (panic) are more
76 // severe than ERR, so they must surface at least as loudly — without them a
77 // fatal connector failure would be logged at debug and hidden.
78 return /\b(?:ERR|WRN|FTL|PNC)\b/u.test(line) ? "warning" : "debug";
76}79}
7780
78function runtimeConfigKey(config: RelayManagedEndpointRuntimeConfig): string {81function runtimeConfigKey(config: RelayManagedEndpointRuntimeConfig): string {