{"record":{"id":"4d92be9e0328a1a7","repo":"m1k1o/neko","slug":"cannot-select-user-in-noauth-mode","errorCode":null,"errorMessage":"cannot select user in noauth mode","messagePattern":"cannot select user in noauth mode","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/member/noauth/provider.go","lineNumber":66,"sourceCode":"\n\tprovider.profile.Name = username\n\treturn id, provider.profile, nil\n}\n\nfunc (provider *MemberProviderCtx) Insert(username string, password string, profile types.MemberProfile) (string, error) {\n\treturn \"\", errors.New(\"new user is created on first login in noauth mode\")\n}\n\nfunc (provider *MemberProviderCtx) UpdateProfile(id string, profile types.MemberProfile) error {\n\treturn nil\n}\n\nfunc (provider *MemberProviderCtx) UpdatePassword(id string, password string) error {\n\treturn errors.New(\"noauth mode does not have password\")\n}\n\nfunc (provider *MemberProviderCtx) Select(id string) (types.MemberProfile, error) {\n\treturn types.MemberProfile{}, errors.New(\"cannot select user in noauth mode\")\n}\n\nfunc (provider *MemberProviderCtx) SelectAll(limit int, offset int) (map[string]types.MemberProfile, error) {\n\treturn map[string]types.MemberProfile{}, nil\n}\n\nfunc (provider *MemberProviderCtx) Delete(id string) error {\n\treturn errors.New(\"cannot delete user in noauth mode\")\n}\n","sourceCodeStart":48,"sourceCodeEnd":76,"githubUrl":"https://github.com/m1k1o/neko/blob/b0f01cedea68893e85a3fd852c0521238c285695/server/internal/member/noauth/provider.go#L48-L76","documentation":"Returned by MemberProviderCtx.Select in the noauth member provider when any code attempts to look up a user profile by ID. In noauth mode there is no user database, so select operations are unsupported and always fail with this error.","triggerScenarios":"Any call to the member Select API (fetch member profile by ID) while the member provider is 'noauth'.","commonSituations":"Admin or client code tries to look up a user profile by ID against a noauth deployment; the lookup always fails because only the implicit anonymous user exists and has no selectable record.","solutions":["Do not perform per-ID member lookups in noauth mode; use the shared anonymous profile.","Switch to multiuser or another dynamic provider if profile lookup is required.","Guard client code to skip Select calls when provider is noauth."],"exampleFix":"// before\nprofile, err := memberClient.Select(id)\n\n// after\nif memberProvider == \"noauth\" {\n    return errors.New(\"no per-user lookup in noauth mode\")\n}\nprofile, err := memberClient.Select(id)","handlingStrategy":"validation","validationCode":"if memberProvider == \"noauth\" {\n    return errors.New(\"no per-user profiles exist in noauth mode\")\n}\nprofile, err := memberClient.Select(id)","typeGuard":"func isNoauthSelectErr(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"cannot select user in noauth\")\n}","tryCatchPattern":"profile, err := memberClient.Select(id)\nif err != nil {\n    if isNoauthSelectErr(err) {\n        profile = types.MemberProfile{Name: \"anonymous\"} // shared noauth profile\n    } else {\n        return err\n    }\n}","preventionTips":["Use the shared anonymous profile instead of per-ID lookups in noauth mode.","Gate profile-dependent features on the member provider type.","Do not build admin user listings against noauth deployments (SelectAll is empty).","Choose a multiuser/dynamic provider when profile lookup is needed."],"tags":["noauth","members","unsupported-operation","lookup"],"backgroundTag":"unsupported-operation-mode","analyzedSha":"b0f01cedea68893e85a3fd852c0521238c285695","analyzedAt":"2026-09-01T10:35:56.638Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}