tailscale/tailscale · error

errProfileNotFound

errProfileNotFound

Error message

profile not found

What it means

Sentinel errProfileNotFound, returned by profile-manager operations (e.g. profileMkdirAllLock with empty ID, DeleteProfile) when the given ProfileID does not exist in the store; DeleteProfile treats it as a no-op success.

Source

Thrown at ipn/ipnlocal/profiles.go:731

	// cause any EditPrefs calls to fail (other than disabling auto-updates).
	//
	// Reset AutoUpdate.Apply if we detect such invalid prefs.
	if savedPrefs.AutoUpdate.Apply.EqualBool(true) && !feature.CanAutoUpdate() {
		savedPrefs.AutoUpdate.Apply.Clear()
	}

	return savedPrefs.View(), nil
}

// CurrentProfile returns a read-only [ipn.LoginProfileView] of the current profile.
// The value may be zero if the profile is not persisted.
func (pm *profileManager) CurrentProfile() ipn.LoginProfileView {
	return pm.currentProfile
}

// errProfileNotFound is returned by methods that accept a ProfileID
// when the specified profile does not exist.
var errProfileNotFound = errors.New("profile not found")

// errProfileAccessDenied is returned by methods that accept a ProfileID
// when the current user does not have access to the specified profile.
// It is used temporarily until we implement access checks based on the
// caller's identity in tailscale/corp#18342.
var errProfileAccessDenied = errors.New("profile access denied")

// DeleteProfile removes the profile with the given id. It returns
// [errProfileNotFound] if the profile does not exist, or an
// [errProfileAccessDenied] if the specified profile is not accessible
// to the current user.
// If the profile is the current profile, it is the equivalent of
// calling [profileManager.NewProfile] followed by [profileManager.DeleteProfile](id).
// This is useful for deleting the last profile. In other cases, it is
// recommended to call [profileManager.SwitchProfile] first.
func (pm *profileManager) DeleteProfile(id ipn.ProfileID) error {
	if id == pm.currentProfile.ID() {
		return pm.deleteCurrentProfile()

View on GitHub (pinned to 6e0912f979)

Solutions

  1. List existing profiles and retry with a valid ProfileID
  2. Callers may treat errors.Is(err, errProfileNotFound) from delete as success
Defensive patterns

Strategy: validation

When it happens

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