Skip to content

Desktop T3 Connect toggle for a remote environment always fails with "Invalid managed endpoint origin" #32422

Closed as duplicate

Description

@ViaxCo

What happened

From the macOS desktop app, I opened Sharing & access for my remote Linux server ("contabo"), which I reach over Tailscale. I turned on T3 Connect. The toggle stays off and shows:

Could not update T3 Connect
Could not obtain environment link proof: Invalid managed endpoint origin.

Image

It fails every time. The error does not say why, or what to do instead.

Diagnosis

The desktop app sends POST /api/connect/link-proof to the remote server through the saved connection URL. For this server that is a Tailscale Serve HTTPS proxy (https://<host>.<tailnet>.ts.net:8443 → http://127.0.0.1:3773). The server rejects the request in two places, and both are deliberate:

  1. linkProof rejects any request with X-Forwarded-Host or X-Forwarded-Proto (apps/server/src/cloud/CloudLink.ts:631). Tailscale Serve adds them. The trace has no environment.cloud.makeLinkProof span, so the request fails here.
  2. Without a proxy, isAllowedEndpointOrigin still rejects it (apps/server/src/cloud/linkChecks.ts:82). The request host is not loopback, and only the desktop-bootstrap principal may use a non-loopback host. The tests in apps/server/src/cloud/http.test.ts ("does not pass desktop trust to a paired client") confirm that a paired remote client must be refused.

So a remote client can never link a host. Only the host can link itself (t3 connect link). But the desktop app still shows the T3 Connect toggle for remote environments and lets the user try. Possible fixes: hide or disable the toggle for remote environments and show the t3 connect link command, or map CloudLinkOriginInvalidError to a message that names it.

A second, smaller problem: after t3 connect link, the CLI always says "Start the server with t3 serve" (apps/server/src/cli/connect.ts:662). On a host where the background service already runs, that starts a second server. The right step is to restart the service.

Steps to reproduce

  1. On a Linux host, run T3 Code as the background service (t3code.service), with T3 Connect not linked.
  2. Expose the server through Tailscale Serve HTTPS (tailscale serve --https=8443 http://127.0.0.1:3773), or through any non-loopback route.
  3. In the macOS desktop app, add the host through that URL and sign in to T3 Connect.
  4. Open Settings → Sharing & access, choose the host, and turn on T3 Connect.
  5. Result: the error above, and HTTP 400 from /api/connect/link-proof.

Version

0.1.8-nightly.20261107.4301 (macOS desktop and Linux server; service launcher 0.1.3-nightly.20261026.3726)

Environment

Server: Linux x64 6.8.0, Node v26.12.1, systemd user service, Tailscale Serve. Client: T3 Code Desktop nightly on macOS (Electron 44.10.1)

Evidence

# server.trace.ndjson, 3 identical failures
environment.cloud.linkProof  exit: Failure
CloudLinkOriginInvalidError: Invalid managed endpoint origin.
    at environment.cloud.linkProof
    at server.runServerCommand
POST /api/connect/link-proof  url.full=http://<host>.<tailnet>.ts.net:8443/api/connect/link-proof
  client.address=127.0.0.1  http.response.status_code=400
  user_agent=... T3CodeNightly/0.1.8-nightly.20261107.4301 ... Electron/44.10.1

# t3 connect status, before the workaround
Exposure: disabled
Authorization: missing
Environment link: not provisioned

Related issues

#27412 and #31534 hit the same loopback-only rule from the iOS Live Activities toggle. #5210 / #11567 hit it from the WSL desktop backend, and #19271 fixed WSL only. This report is about the desktop toggle for a remote, paired environment, which none of them covers.

Fix applied or workaround

Verified on the host:

~/.t3/runtime/versions/0.1.8-nightly.20261107.4301/t3 connect link --headless   # device-code sign-in
systemctl --user restart t3code.service
t3 connect status
# Environment link: provisioned · ✓ Other devices can reach this machine · Tunnel connected · 4 connections · QUIC

Filed by

Claude Code (claude-opus-5-5) via t3 triage

Activity

  1. juliusmarminge commented on Nov 19, 2026

    @juliusmarminge
    Member

    This is the same problem as #38892, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

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

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions