{"record":{"id":"b16e2f598fb31cab","repo":"m1k1o/neko","slug":"member-does-not-exist","errorCode":null,"errorMessage":"member does not exist","messagePattern":"member does not exist","errorType":"error_code","errorClass":"ErrMemberDoesNotExist","httpStatus":null,"severity":"error","filePath":"server/pkg/types/member.go","lineNumber":7,"sourceCode":"package types\n\nimport \"errors\"\n\nvar (\n\tErrMemberAlreadyExists   = errors.New(\"member already exists\")\n\tErrMemberDoesNotExist    = errors.New(\"member does not exist\")\n\tErrMemberInvalidPassword = errors.New(\"invalid password\")\n)\n\ntype MemberProfile struct {\n\tName string `json:\"name\"`\n\n\t// permissions\n\tIsAdmin               bool `json:\"is_admin\"                 mapstructure:\"is_admin\"`\n\tCanLogin              bool `json:\"can_login\"                mapstructure:\"can_login\"`\n\tCanConnect            bool `json:\"can_connect\"              mapstructure:\"can_connect\"`\n\tCanWatch              bool `json:\"can_watch\"                mapstructure:\"can_watch\"`\n\tCanHost               bool `json:\"can_host\"                 mapstructure:\"can_host\"`\n\tCanShareMedia         bool `json:\"can_share_media\"          mapstructure:\"can_share_media\"`\n\tCanAccessClipboard    bool `json:\"can_access_clipboard\"     mapstructure:\"can_access_clipboard\"`\n\tSendsInactiveCursor   bool `json:\"sends_inactive_cursor\"    mapstructure:\"sends_inactive_cursor\"`\n\tCanSeeInactiveCursors bool `json:\"can_see_inactive_cursors\" mapstructure:\"can_see_inactive_cursors\"`\n\n\t// plugin scope","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/m1k1o/neko/blob/b0f01cedea68893e85a3fd852c0521238c285695/server/pkg/types/member.go#L1-L25","documentation":"ErrMemberDoesNotExist is a sentinel error in the neko server's types package indicating that a member (user account) lookup failed because no member with the given id/username exists in the configured member provider (e.g. file or database backend). It is returned by member operations such as Login, ExtractMember, UpdateProfile, UpdatePassword, Delete, and getEntry when the referenced account cannot be found.","triggerScenarios":"Calling Login with a username not present in the member store; UpdateProfile, UpdatePassword, or Delete with an unknown/expired member id; ExtractMember resolving a session whose member record was deleted; getEntry when the underlying provider (file/db) has no entry for the requested id.","commonSituations":"Pointing the server at a fresh/empty member database or a different data directory than expected; deleting a member while their session is still alive; typos in usernames in API calls or config seeds; migration from another auth provider leaving stale member references.","solutions":["Verify the member id/username exists in the configured member provider before calling the API (list members or query the store directly).","Check that the server's member provider backend (file/database path, connection) points at the data source that actually contains the account.","Re-create the missing member account with the expected credentials/profile.","If the member was deleted, invalidate the referencing session and re-authenticate.","Enable provider logging to confirm which lookup (id vs username) failed."],"exampleFix":"// before\nprofile, err := memberManager.Select(id) // panics later or fails with ErrMemberDoesNotExist\nif err != nil {\n    return err\n}\n// after\nprofile, err := memberManager.Select(id)\nif errors.Is(err, types.ErrMemberDoesNotExist) {\n    return fmt.Errorf(\"member %q not found, check provider backend\", id)\n} else if err != nil {\n    return err\n}","handlingStrategy":"type-guard","validationCode":"// Go: check membership before operating\nif _, ok := members[id]; !ok {\n    return fmt.Errorf(\"member %q does not exist\", id)\n}","typeGuard":"func MemberExists(m types.MemberProvider, id string) bool {\n    _, err := m.Select(id)\n    return err == nil\n}","tryCatchPattern":"if err != nil {\n    if errors.Is(err, types.ErrMemberDoesNotExist) {\n        // handle missing member: create it or return 404\n        return\n    }\n    return err\n}","preventionTips":["Always errors.Is-check sentinel errors instead of comparing strings.","List members before mutating an unknown id.","Keep member store and session store in sync (delete sessions when deleting members).","Seed and back up the member provider data source."],"tags":["auth","member","not-found","go"],"backgroundTag":"user-not-found","analyzedSha":"b0f01cedea68893e85a3fd852c0521238c285695","analyzedAt":"2026-09-01T10:35:56.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}