tailscale/tailscale · error

parsing saved prefs: %w

Error message

parsing saved prefs: %w

What it means

Raised by loadSavedPrefs when the stored prefs bytes cannot be decoded into ipn.Prefs even after ignoring the attestation key. The persisted state is corrupted or from an incompatible version.

Source

Thrown at ipn/ipnlocal/profiles.go:694

	}
	savedPrefs := ipn.NewPrefs()

	// if supported by the platform, create an empty hardware attestation key to use when deserializing
	// to avoid type exceptions from json.Unmarshaling into an interface{}.
	hw, _ := pm.newEmptyHardwareAttestationKey()
	savedPrefs.Persist = &persist.Persist{
		AttestationKey: hw,
	}

	if err := ipn.PrefsFromBytes(bs, savedPrefs); err != nil {
		// Try loading again, this time ignoring the AttestationKey contents.
		// If that succeeds, there's something wrong with the underlying
		// attestation key mechanism (most likely the TPM changed), but we
		// should at least proceed with client startup.
		origErr := err
		savedPrefs.Persist.AttestationKey = &noopAttestationKey{}
		if err := ipn.PrefsFromBytes(bs, savedPrefs); err != nil {
			return ipn.PrefsView{}, fmt.Errorf("parsing saved prefs: %w", err)
		} else {
			pm.logf("failed to parse savedPrefs with attestation key (error: %v) but parsing without the attestation key succeeded; will proceed without using the old attestation key", origErr)
		}
	}
	pm.logf("using backend prefs for %q: %v", k, savedPrefs.Pretty())

	// Ignore any old stored preferences for https://login.tailscale.com
	// as the control server that would override the new default of
	// controlplane.tailscale.com.
	if savedPrefs.ControlURL != "" &&
		savedPrefs.ControlURL != ipn.DefaultControlURL &&
		ipn.IsLoginServerSynonym(savedPrefs.ControlURL) {
		savedPrefs.ControlURL = ""
	}
	// Before
	// https://github.com/tailscale/tailscale/pull/11814/commits/1613b18f8280c2bce786980532d012c9f0454fa2#diff-314ba0d799f70c8998940903efb541e511f352b39a9eeeae8d475c921d66c2ac
	// prefs could set AutoUpdate.Apply=true via EditPrefs or tailnet
	// auto-update defaults. After that change, such value is "invalid" and

View on GitHub (pinned to 6e0912f979)

Solutions

  1. Inspect the prefs JSON in the state store.
  2. Remove the profile's prefs and re-authenticate.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at ipn/ipnlocal/profiles.go:694 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/49a2b23bc168f5da. Report an issue: GitHub.