Skip to content

[Bug]: Relinking a revoked T3 Connect environment to a different account fails with "already linked to a different cloud account" #34193

Closed

Description

@Derpedyea

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Link an environment to T3 Connect with cloud account A.
  2. Remove that environment from account A in T3 Connect. The server's next relay request gets a 401 and it marks the link revoked (cloud-link-revoked), keeping the old link secrets.
  3. Sign in to a different cloud account B in the desktop or web app and link the same environment from the T3 Connect UI.

Expected behavior

The revoked link no longer ties the environment to account A, so linking it to account B succeeds.

Actual behavior

Linking fails with:

Could not configure environment relay access: This environment is already linked to a different cloud account. Unlink it before switching accounts.

Impact

Major degradation or frequent failure

Version or commit

0.1.9-nightly.20261111.4501; still reproduces on main @ 034f3ba

Environment

macOS (arm64), desktop app

Root cause

markLinkRevoked in apps/server/src/cloud/CloudLink.ts only sets cloud-link-revoked and keeps cloud-linked-user-id, the relay credential, mint key, and endpoint runtime config (on purpose: clock skew can cause false 401s). applyCloudRelayConfig then calls validateLinkedCloudUser, which compares the new account against the stale cloud-linked-user-id without looking at the revoked mark, so it fails with CloudLinkAccountMismatchError.

CliState.dropRevokedCloudLink clears exactly this stale state, but only t3 connect link (linkEnvironmentForConnect) calls it. The UI path (applyRelayConfig) and the managed-link/startup reconcile path never do.

Related: #21857 (same guard, but there the old link is still active).

Workaround

On the server machine, run t3 connect link. It drops the revoked link first ("Replacing the link T3 Connect revoked.") and then links to the signed-in account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions