You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: T3 Connect deregistration reports failure while the server disappears #36396
I included enough detail to reproduce or investigate the problem.
Area
apps/web — Account → T3 Connect registered servers
Steps to reproduce
Open Account → T3 Connect with registered managed-tunnel servers.
With T3 Connect unavailable or disabled for one registered server, choose Deregister and confirm.
Observe the result toast and the registered-server list/count.
Expected behavior
The result should match the authoritative deregistration state. If the account registration was removed but tunnel cleanup could not complete, report removal as successful and explain the cleanup problem separately. If deregistration failed, keep or reload the server row and offer a retry path.
Actual behavior
In a macOS screen recording captured on 2026-11-13, confirming Deregister removes the selected row and changes the count from 3 of 3 tunnels in use to 2 of 3, while showing this error toast:
Could not deregister server — T3 Connect is unavailable. Try again.
The recording establishes the mismatch between the error and the UI state; it does not establish whether the account-side deletion committed or the list was updated optimistically.
Impact
Minor bug or occasional failure — the contradictory result makes it unclear whether to retry and whether the server is still registered.
Version or commit
Not visible in the recording. Captured 2026-11-13.
Environment
macOS, T3 Code desktop app. Exact OS and app version are not visible in the recording.
Logs or stack traces
Toast text: Could not deregister server. T3 Connect is unavailable. Try again. No trace ID was captured.
Workaround
Refresh or reopen the T3 Connect account page to check whether the server is still listed. This was not verified in the recording.
I tried to reproduce this on the current build and could not.
Live reproduction was not possible: the hosted T3 Connect relay and Cloudflare managed tunnels are not available on any worker. On origin/main b5b4705 I traced Account → T3 Connect → Deregister. apps/web/src/components/clerk/T3ConnectUserProfilePage.tsx calls DELETE /v1/client/environment-links/:id. The relay handler (infra/relay/src/http/Api.ts unlinkEnvironment → unlinkEnvironmentRecord) commits the link and credential revocation in its own transaction, then calls managedEndpointProvider.deprovision. A ManagedEndpointDeprovisioningFailed from that call fails the request and is mapped to RelayInternalError(upstream_unavailable). The web relayFailureReason turns that into 'T3 Connect is unavailable. Try again.' The page's failure branch still calls environmentsState.refresh(), so the already-revoked row disappears and the tunnel count drops. To prove the relay half, I added one case to the existing 'relay environment unlink' describe in infra/relay/src/http/Api.test.ts: link found and revoked, then deprovision fails at stage delete-tunnel, expecting unlinkEnvironmentRecord to return true. vp test run src/http/Api.test.ts -t "relay environment unlink" in infra/relay fails that case with ManagedEndpointDeprovisioningFailed; the other 5 unlink tests pass.
Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
I reproduced this on macOS in the T3 Code desktop app on November 13, 2026.
Version: 0.1.9 (24e7747)
Steps: Open Account → T3 Connect, choose Deregister for a registered server while T3 Connect is disabled/unavailable, and confirm.
Result: The selected server disappears and the usage count changes from 3 of 3 to 2 of 3, but the toast says: “Could not deregister server. T3 Connect is unavailable. Try again.” The attached recording shows the sequence.
This matches the behavior described in the issue: deregistration appears to take effect, but failed tunnel cleanup is reported as if deregistration failed.
// The relay may have removed it before failing.environmentsState.refresh();
That branch subsequently creates the error toast. This explains how persisted revocation and an error toast can coexist; the row disappearing is not necessarily an optimistic-update bug.
Remaining diagnostic gap: the recording does not establish which cleanup operation failed. The failure branch logs environmentId, traceId, and cause, and offers Copy trace ID when available. Correlating that trace with relay logs would distinguish an active-connector deletion rejection from another cleanup failure.
The API supports retrying cleanup for an already-revoked link, but once the refreshed account list removes that row, its Deregister action is no longer available there.
Activity
juliusmarminge commentedon Nov 13, 2026
I tried to reproduce this on the current build and could not.
Live reproduction was not possible: the hosted T3 Connect relay and Cloudflare managed tunnels are not available on any worker. On origin/main b5b4705 I traced Account → T3 Connect → Deregister. apps/web/src/components/clerk/T3ConnectUserProfilePage.tsx calls DELETE /v1/client/environment-links/:id. The relay handler (infra/relay/src/http/Api.ts unlinkEnvironment → unlinkEnvironmentRecord) commits the link and credential revocation in its own transaction, then calls managedEndpointProvider.deprovision. A ManagedEndpointDeprovisioningFailed from that call fails the request and is mapped to RelayInternalError(upstream_unavailable). The web relayFailureReason turns that into 'T3 Connect is unavailable. Try again.' The page's failure branch still calls environmentsState.refresh(), so the already-revoked row disappears and the tunnel count drops. To prove the relay half, I added one case to the existing 'relay environment unlink' describe in infra/relay/src/http/Api.test.ts: link found and revoked, then deprovision fails at stage delete-tunnel, expecting unlinkEnvironmentRecord to return true.
vp test run src/http/Api.test.ts -t "relay environment unlink"in infra/relay fails that case with ManagedEndpointDeprovisioningFailed; the other 5 unlink tests pass.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
dl-alexandre commentedon Nov 13, 2026
Screen.Recording.2026-11-13.at.12.09.42.PM.mov
I reproduced this on macOS in the T3 Code desktop app on November 13, 2026.
Version: 0.1.9 (24e7747)
Steps: Open Account → T3 Connect, choose Deregister for a registered server while T3 Connect is disabled/unavailable, and confirm.
Result: The selected server disappears and the usage count changes from 3 of 3 to 2 of 3, but the toast says: “Could not deregister server. T3 Connect is unavailable. Try again.” The attached recording shows the sequence.
This matches the behavior described in the issue: deregistration appears to take effect, but failed tunnel cleanup is reported as if deregistration failed.
dl-alexandre commentedon Nov 13, 2026
Investigating the recording against commit
b5b470542a5fb95aed16f3d3a23f8cd8de17e5d8, I found a concrete failure-after-revocation path:1. Revocation commits before tunnel cleanup
unlinkEnvironmentRecord, Api.ts L522–535 callsrevokeEnvironmentLinkRecord(...)beforemanagedEndpointProvider.deprovision(...). The source explicitly says:// Deprovision after revocation commits; retry even if already revoked to finish failed Cloudflare cleanup.A subsequent deprovisioning failure therefore does not undo revocation.
2. That cleanup failure becomes an API error
Api.ts L953–964 maps:
3. The UI explicitly refreshes the list on failure, then displays “Could not deregister server”
T3ConnectUserProfilePage.tsx L214–241:
That branch subsequently creates the error toast. This explains how persisted revocation and an error toast can coexist; the row disappearing is not necessarily an optimistic-update bug.
Remaining diagnostic gap: the recording does not establish which cleanup operation failed. The failure branch logs
environmentId,traceId, andcause, and offers Copy trace ID when available. Correlating that trace with relay logs would distinguish an active-connector deletion rejection from another cleanup failure.The API supports retrying cleanup for an already-revoked link, but once the refreshed account list removes that row, its Deregister action is no longer available there.