Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): recover a deleted tunnel when Cloudflare says "Tunnel not found" #16648

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/16648/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 127 additions and 5 deletions.

x
0 of 2 viewed, 2 left
91 additions and 0 deletionsapps/server/src/cloud/ManagedEndpointRuntime.test.tsModified
View file
@@ -185,11 +185,27 @@
'2026-06-17T02:00:00Z ERR Register tunnel error from server side error="Unauthorized: Invalid tunnel secret" connIndex=0',
).toBe(true);
+ // Seen in production on 2026-10-06 after the relay deleted an idle tunnel.
+ expect(
+ ManagedEndpointRuntime.isRejectedRelayClientTunnelOutput(
+ '2026-10-06T12:00:00Z ERR Register tunnel error from server side error="Unauthorized: Tunnel not found" connIndex=0 event=0 ip=198.41.200.23',
+ ),
+ ).toBe(true);
+ expect(
+ ManagedEndpointRuntime.isRejectedRelayClientTunnelOutput(
+ '2026-10-06T12:00:00Z ERR Register tunnel error from server side error="Tunnel not found" connIndex=0',
+ ),
+ ).toBe(true);
expect(
ManagedEndpointRuntime.isRejectedRelayClientTunnelOutput(
'2026-06-17T02:00:00Z ERR Register tunnel error from server side error="connection timed out" connIndex=0',
).toBe(false);
+ expect(
+ ManagedEndpointRuntime.isRejectedRelayClientTunnelOutput(
+ '2026-06-17T02:00:00Z ERR Failed to serve tunnel connection error="Unauthorized: Tunnel not found" connIndex=0',
+ ),
+ ).toBe(false);
});
​
it.effect("keeps recovery requests sent before the server starts consuming them", () =>
@@ -318,6 +334,81 @@