tailscale/tailscale · error

calling ReadState on state store: %w

Error message

calling ReadState on state store: %w

What it means

Raised by readAutoStartKey when reading the current-profile key from the state store fails with something other than not-exist. The state store backend is unreadable, so the profile manager cannot determine which profile to start.

Source

Thrown at ipn/ipnlocal/profiles.go:907

	return pm.CurrentPrefs(), nil
}

// newProfileManager creates a new [profileManager] using the provided [ipn.StateStore].
// It also loads the list of known profiles from the store.
func newProfileManager(store ipn.StateStore, logf logger.Logf, health *health.Tracker) (*profileManager, error) {
	return newProfileManagerWithGOOS(store, logf, health, envknob.GOOS())
}

func readAutoStartKey(store ipn.StateStore, goos string) (ipn.StateKey, error) {
	startKey := ipn.CurrentProfileStateKey
	if goos == "windows" {
		// When tailscaled runs on Windows it is not typically run unattended.
		// So we can't use the profile mechanism to load the profile at startup.
		startKey = ipn.ServerModeStartKey
	}
	autoStartKey, err := store.ReadState(startKey)
	if err != nil && err != ipn.ErrStateNotExist {
		return "", fmt.Errorf("calling ReadState on state store: %w", err)
	}
	return ipn.StateKey(autoStartKey), nil
}

func readKnownProfiles(store ipn.StateStore) (map[ipn.ProfileID]ipn.LoginProfileView, error) {
	var knownProfiles map[ipn.ProfileID]ipn.LoginProfileView
	prfB, err := store.ReadState(ipn.KnownProfilesStateKey)
	switch err {
	case nil:
		if err := json.Unmarshal(prfB, &knownProfiles); err != nil {
			return nil, fmt.Errorf("unmarshaling known profiles: %w", err)
		}
	case ipn.ErrStateNotExist:
		knownProfiles = make(map[ipn.ProfileID]ipn.LoginProfileView)
	default:
		return nil, fmt.Errorf("calling ReadState on state store: %w", err)
	}
	return knownProfiles, nil

View on GitHub (pinned to 6e0912f979)

Solutions

  1. Check the state store path and permissions.
  2. Inspect the wrapped backend error.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at ipn/ipnlocal/profiles.go:907 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tailscale/tailscale@6e0912f979 (2026-08-18). Data as JSON: /api/errors/b985c4c19d359916. Report an issue: GitHub.