[Bug]: Host stops answering mint-credential/assets after a client sleeps mid-request: ServerSecretStore.get blocked 17.6 h behind dpop.verifyRequestDpopProof #24897
Summary#
On the host, a single in-flight authenticated request over T3 Connect can stall inside DPoP verification and never finish. While it is stuck, every ServerSecretStore.get call blocks behind it. All secret-dependent work hangs, including mint-credential, assets.createUrl, websocket tickets, ConnectReachability.check and background sweeps. Remote clients sit at "reconnecting · T3 Connect returned an error" until that one request is interrupted, which took 17.6 hours in my case.
Requests that do not touch secrets keep working, so the host looks half alive. The tunnel itself stays healthy the whole time: 4 registered connections and no unregistrations.
Environment#
- Host: macOS, Apple Silicon (arm64), background service install
- Version:
t3 v0.1.3-nightly.20261024.3630(host and client on the same build) - Remote access: T3 Connect managed tunnel (bundled cloudflared 2026.10.0)
- Client: T3 Code desktop on a MacBook (arm64)
Steps to reproduce (observed twice)#
- Connect from a laptop to a remote host over T3 Connect.
- Close the laptop lid (the laptop sleeps) while connected.
- Wake the laptop. The host connection shows "reconnecting · T3 Connect returned an error" and never recovers.
Evidence (from the host's server trace and service log)#
Local check on the host while it was broken:
curl http://127.0.0.1:3773/api/auth/session -> 200 in ~3 ms
curl http://127.0.0.1:3773/api/t3-connect/mint-credential -> no response, timed out at 15 s
cloudflared logged a stream of Incoming request ended abruptly: context canceled for /api/t3-connect/mint-credential, /api/auth/session, /api/auth/websocket-ticket and /api/orchestration/shell, as each client attempt gave up. The server logged Relay client reported a transport warning for each one.
Long spans from server.trace.ndjson, with times relative to T0 = the first stuck request:
| start | duration | span | exit |
|---|---|---|---|
| T0 | 63,537 s | GET /api/auth/session > EnvironmentAuth.authenticateHttpRequest > dpop.verifyRequestDpopProof | Interrupted |
| T0 | 63,537 s | EnvironmentAuth.getSessionState | Interrupted |
| T0 + 21 s | 63,515 s | POST /api/auth/websocket-ticket > dpop.verifyRequestDpopProof | Interrupted |
| T0 + 33 s | 63,503 s | ServerSecretStore.get | Success |
| T0 + 33 s | 63,504 s | ConnectReachability.check | Success |
| T0 + 35 min | 61,404 s | SecretRequests.sweepExpired, PullRequestReadCache.pruneExpiredEntryFiles, replayMarkers.pruneExpired | Success |
| T0 + 8.3 h | 33,608 s | ServerSecretStore.get (via AgentAwarenessRelay.publishThread) | Success |
Every one of these spans ended within the same second (T0 + 63,537 s), when the original requests were finally interrupted. t3 trace summary showed ServerSecretStore.get with p50 0 ms and max 63,503 s. The same pattern appears for AssetAccess.issueAssetUrl / ws.rpc.assets.createUrl, EnvironmentAuth.authenticateHttpRequest and dpop.verifyRequestDpopProof.
No other t3 process (CLI, doctor or triage) was running during this window, so the lock was held inside the server process.
Likely cause#
A request that starts DPoP verification takes a lock (or a serialized section) around the secret store and the replay-marker path. It then waits on something that never resolves, most likely the half-open request from a client that went to sleep. The lock has no timeout and isn't released until the request fiber is interrupted, and cloudflared can keep that stream open for many hours.
Expected#
- A stuck or abandoned request should not block
ServerSecretStore.getfor other requests. - DPoP verification / secret reads should have a timeout, or the lock should not be held across awaiting client I/O.
Workaround#
t3 service restart on the host clears it immediately.
Possibly related#
#21302 (T3 Connect sockets close when the DPoP access token expires)
tanstack-source added labelsbug
This is the same problem as #26417, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.
juliusmarminge closed this
Sign in to join this conversation.
Thanks for the detailed trace. We looked for a lock around the secret store or DPoP verification and didn't find one.
ServerSecretStore.getis a plain file read, and DPoP verification doesn't read the request body; its only wait is the replay-marker file write.Your table also shows
PullRequestReadCache.pruneExpiredEntryFilesstuck for the same 17.6 h, and that job never touches secrets. So it looks like every async file operation in the server stalled, while requests that don't touch files kept answering. That fits Node's file-system thread pool (4 threads by default) being fully occupied by calls that never return. We haven't confirmed what occupies it.Next time it happens, before restarting, could you:
sample <t3 server pid> 5 -file /tmp/t3-sample.txton the host and attach the file. The libuv worker thread stacks will show which system call is blocked./Volumes/...) that might have gone away around then.