From 15652c4e278baeff5bb2a8890a80c4f1682fb4fc Mon Sep 17 00:00:00 2001 From: Kabir Sikand Date: Mon, 18 May 2026 17:48:42 +0000 Subject: [PATCH] cmd/tailscale/cli: kick off login after Start in tailscale join LocalClient.Start applies prefs and stashes the auth key but does not actually drive a login: when the daemon has no node key it transitions NoState -> NeedsLogin and waits. tailscale up handles this by calling StartLoginInteractive immediately after Start when HaveNodeKey is false (see cmd/tailscale/cli/up.go:683-688). join omitted that call, so the join command would print "Bound to blueprint bp:" while the daemon silently sat in NeedsLogin without ever registering the node against the control plane. Always kick the login from join. The earlier status check refuses to run if BackendState is Running, so by the time we reach Start we know we are doing a fresh registration; there is no HaveNodeKey case worth preserving. Updates #cleanup Signed-off-by: Kabir Sikand --- cmd/tailscale/cli/join.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/tailscale/cli/join.go b/cmd/tailscale/cli/join.go index 93b214a6c..77d3cfe59 100644 --- a/cmd/tailscale/cli/join.go +++ b/cmd/tailscale/cli/join.go @@ -184,6 +184,16 @@ func runJoin(ctx context.Context, args []string, ja *joinArgsT) (retErr error) { }); err != nil { return fmt.Errorf("starting tailscale: %w", err) } + // Start alone applies prefs and stores the auth key; the daemon + // then waits in NeedsLogin until something asks it to log in. + // tailscale up handles this by calling StartLoginInteractive when + // the daemon has no node key (see cmd/tailscale/cli/up.go). join + // is by definition a fresh registration -- the earlier status + // check refuses to run if BackendState is already Running -- so + // we always trigger the login here. + if err := localClient.StartLoginInteractive(ctx); err != nil { + return fmt.Errorf("kicking off blueprint join login: %w", err) + } metricBlueprintJoinSuccess.Add(1) metricBlueprintBound.Set(1)