From 6612bed24df2d561e8b99f4573f48e4aa96bd52c Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 16 Sep 2026 04:21:17 +0000 Subject: [PATCH] ipn/desktop: skip the extension when sessions can't be enumerated Registering the session state callback enumerates the existing desktop sessions, which fails for a tailscaled run by an unprivileged user (WTSEnumerateSessions returns "No more data is available"). That was reported as "init failed", which reads like a bug. Such a tailscaled has no other users' sessions to track, so report it as skipping the extension, the same way an unavailable session manager already is. Updates #2791 Signed-off-by: Brad Fitzpatrick Change-Id: I7f9b1d3e5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b --- ipn/desktop/extension.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ipn/desktop/extension.go b/ipn/desktop/extension.go index 97a192091..2f9d46695 100644 --- a/ipn/desktop/extension.go +++ b/ipn/desktop/extension.go @@ -101,7 +101,11 @@ func (e *desktopSessionsExt) Init(host ipnext.Host) (err error) { e.host = host unregisterSessionCb, err := e.sm.RegisterStateCallback(e.updateDesktopSessionState) if err != nil { - return fmt.Errorf("session callback registration failed: %w", err) + // Registering the callback enumerates the existing desktop + // sessions, which fails for a tailscaled run by an unprivileged + // user. That is not an error worth alarming about: such a + // tailscaled has no other users' sessions to track anyway. + return fmt.Errorf("%w: session callback registration failed: %w", ipnext.SkipExtension, err) } unregisterPolicyCb, err := e.sm.RegisterInitCallback(e.initUserPolicyStore) if err != nil {