{"record":{"id":"bb9de5edaee59bea","repo":"tailscale/tailscale","slug":"errprofilenotfound","errorCode":"errProfileNotFound","errorMessage":"profile not found","messagePattern":"profile not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ipn/ipnlocal/profiles.go","lineNumber":731,"sourceCode":"\t// cause any EditPrefs calls to fail (other than disabling auto-updates).\n\t//\n\t// Reset AutoUpdate.Apply if we detect such invalid prefs.\n\tif savedPrefs.AutoUpdate.Apply.EqualBool(true) && !feature.CanAutoUpdate() {\n\t\tsavedPrefs.AutoUpdate.Apply.Clear()\n\t}\n\n\treturn savedPrefs.View(), nil\n}\n\n// CurrentProfile returns a read-only [ipn.LoginProfileView] of the current profile.\n// The value may be zero if the profile is not persisted.\nfunc (pm *profileManager) CurrentProfile() ipn.LoginProfileView {\n\treturn pm.currentProfile\n}\n\n// errProfileNotFound is returned by methods that accept a ProfileID\n// when the specified profile does not exist.\nvar errProfileNotFound = errors.New(\"profile not found\")\n\n// errProfileAccessDenied is returned by methods that accept a ProfileID\n// when the current user does not have access to the specified profile.\n// It is used temporarily until we implement access checks based on the\n// caller's identity in tailscale/corp#18342.\nvar errProfileAccessDenied = errors.New(\"profile access denied\")\n\n// DeleteProfile removes the profile with the given id. It returns\n// [errProfileNotFound] if the profile does not exist, or an\n// [errProfileAccessDenied] if the specified profile is not accessible\n// to the current user.\n// If the profile is the current profile, it is the equivalent of\n// calling [profileManager.NewProfile] followed by [profileManager.DeleteProfile](id).\n// This is useful for deleting the last profile. In other cases, it is\n// recommended to call [profileManager.SwitchProfile] first.\nfunc (pm *profileManager) DeleteProfile(id ipn.ProfileID) error {\n\tif id == pm.currentProfile.ID() {\n\t\treturn pm.deleteCurrentProfile()","sourceCodeStart":713,"sourceCodeEnd":749,"githubUrl":"https://github.com/tailscale/tailscale/blob/6e0912f97994f927632b34ae9e63b53d6516a6ac/ipn/ipnlocal/profiles.go#L713-L749","documentation":"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.","triggerScenarios":"Thrown at ipn/ipnlocal/profiles.go:731 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List existing profiles and retry with a valid ProfileID","Callers may treat errors.Is(err, errProfileNotFound) from delete as success"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6e0912f97994f927632b34ae9e63b53d6516a6ac","analyzedAt":"2026-08-18T08:17:25.280Z","contentChangedAt":"2026-08-18T08:17:25.280Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}