{"record":{"id":"8bfa8ea5fba24227","repo":"mattermost-community/focalboard","slug":"no-user-id","errorCode":null,"errorMessage":"no user ID","messagePattern":"no user ID","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/app/auth.go","lineNumber":57,"sourceCode":"\treturn a.store.GetActiveUserCount(secondsAgo)\n}\n\n// GetWeeklyActiveUsers returns the number of weekly active users.\nfunc (a *App) GetWeeklyActiveUsers() (int, error) {\n\tsecondsAgo := int64(SecondsPerMinute * MinutesPerHour * HoursPerDay * DaysPerWeek)\n\treturn a.store.GetActiveUserCount(secondsAgo)\n}\n\n// GetMonthlyActiveUsers returns the number of monthly active users.\nfunc (a *App) GetMonthlyActiveUsers() (int, error) {\n\tsecondsAgo := int64(SecondsPerMinute * MinutesPerHour * HoursPerDay * DaysPerMonth)\n\treturn a.store.GetActiveUserCount(secondsAgo)\n}\n\n// GetUser gets an existing active user by id.\nfunc (a *App) GetUser(id string) (*model.User, error) {\n\tif len(id) < 1 {\n\t\treturn nil, errors.New(\"no user ID\")\n\t}\n\n\tuser, err := a.store.GetUserByID(id)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to find user\")\n\t}\n\treturn user, nil\n}\n\nfunc (a *App) GetUsersList(userIDs []string) ([]*model.User, error) {\n\tif len(userIDs) == 0 {\n\t\treturn nil, errors.New(\"No User IDs\")\n\t}\n\n\tusers, err := a.store.GetUsersList(userIDs, a.config.ShowEmailAddress, a.config.ShowFullName)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to find users\")\n\t}","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/mattermost-community/focalboard/blob/a84bbb65e32edf972856b329417096ac413518e9/server/app/auth.go#L39-L75","documentation":"GetUser returns this error when called with an empty user ID string. The App layer guards before querying the store, since GetUserByID cannot resolve an empty identifier. It is a caller-input validation error, not a data problem.","triggerScenarios":"Calling a.GetUser(\"\") — e.g. ImportBoardJSONL resolving a user ID that came back as an empty string from parsed JSONL fields.","commonSituations":"Board/user JSON imports with missing or blank owner/user id fields; unchecked string fields from webhook or API payloads used directly as user IDs.","solutions":["Validate len(id) > 0 before calling GetUser","Fix the data source so user IDs are populated before import","Skip or substitute users with missing IDs during import"],"exampleFix":"// before\nuser, _ := app.GetUser(idFromJSON)\n// after\nif idFromJSON == \"\" {\n    return errors.New(\"import record missing user id\")\n}\nuser, err := app.GetUser(idFromJSON)","handlingStrategy":"validation","validationCode":"if id == \"\" {\n    return nil, errors.New(\"cannot look up user: id is empty\")\n}","typeGuard":"func hasUserID(id string) bool { return strings.TrimSpace(id) != \"\" }","tryCatchPattern":"user, err := a.GetUser(id)\nif err != nil {\n    if err.Error() == \"no user ID\" {\n        return fmt.Errorf(\"skipping: no user id provided\")\n    }\n    return errors.Wrap(err, \"get user failed\")\n}","preventionTips":["Validate all entity IDs at the parse/import boundary","Use custom ID types so empty IDs can't flow silently","Log-and-skip records with missing IDs instead of failing the whole import"],"tags":["validation","auth","empty-input"],"backgroundTag":"missing-required-parameter","analyzedSha":"a84bbb65e32edf972856b329417096ac413518e9","analyzedAt":"2026-08-30T09:22:20.720Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}