{"record":{"id":"d672c7176646146b","repo":"bytebase/bytebase","slug":"cannot-found-user-s","errorCode":null,"errorMessage":"cannot found user %s","messagePattern":"cannot found user (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/api/v1/issue_service.go","lineNumber":440,"sourceCode":"\t\treturn nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, \"failed to convert to issue\"))\n\t}\n\treturn connect.NewResponse(&v1pb.SearchIssuesResponse{\n\t\tIssues:        converted,\n\t\tNextPageToken: nextPageToken,\n\t}), nil\n}\n\nfunc (s *IssueService) getUserByIdentifier(ctx context.Context, identifier string) (*store.UserMessage, error) {\n\temail := strings.TrimPrefix(identifier, \"users/\")\n\tif email == \"\" {\n\t\treturn nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf(\"invalid empty creator identifier\"))\n\t}\n\taccount, err := s.store.GetAccountByEmail(ctx, email)\n\tif err != nil {\n\t\treturn nil, connect.NewError(connect.CodeInternal, errors.Errorf(`failed to find user \"%s\" with error: %v`, email, err.Error()))\n\t}\n\tif account == nil {\n\t\treturn nil, errors.Errorf(\"cannot found user %s\", email)\n\t}\n\treturn &store.UserMessage{\n\t\tEmail:         account.Email,\n\t\tName:          account.Name,\n\t\tType:          account.Type,\n\t\tMemberDeleted: account.MemberDeleted,\n\t}, nil\n}\n\n// CreateIssue creates a issue.\nfunc (s *IssueService) CreateIssue(ctx context.Context, req *connect.Request[v1pb.CreateIssueRequest]) (*connect.Response[v1pb.Issue], error) {\n\tif err := rejectMCPOriginatedGrantIssue(ctx, req.Msg.GetIssue().GetType()); err != nil {\n\t\treturn nil, err\n\t}\n\tprojectID, err := common.GetProjectID(req.Msg.Parent)\n\tif err != nil {\n\t\treturn nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf(\"%v\", err.Error()))\n\t}","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/bytebase/bytebase/blob/1870550677fe08f0d2a78c07acd27541464eb945/backend/api/v1/issue_service.go#L422-L458","documentation":"getUserByIdentifier resolves an issue assignee/creator by email. After looking the account up via store.GetAccountByEmail, a nil account means no user row matches that email; the code returns a plain (non-connect) error 'cannot found user %s'. It signals the referenced email does not correspond to any registered account.","triggerScenarios":"Calling CreateIssue/UpdateIssue with an assignee or creator email that does not exist in the user store; typo'd or stale email in the issue payload; user deleted from the workspace but still referenced.","commonSituations":"Offboarding: user removed from Bytebase but a pipeline/template still references their email; LDAP/SSO email casing mismatches; test fixtures with fabricated emails.","solutions":["Verify the email exists via the user list API or users table before referencing it","Fix the typo/casing in the email in the issue payload","Re-add or restore the user account if it was deleted","Use the user's canonical login email (matching the account row) rather than an alias"],"exampleFix":"// before\nassignee: \"jane.doe@corp.com\" // deleted user\n// after\nassignee: \"jane.doe-new@corp.com\" // existing account","handlingStrategy":"validation","validationCode":"u, err := client.GetUser(ctx, email)\nif err != nil || u == nil { return fmt.Errorf(\"user %s does not exist\", email) }","typeGuard":"func userExists(u *store.UserMessage) bool { return u != nil && u.Email != \"\" }","tryCatchPattern":null,"preventionTips":["Validate assignee/creator emails against the user directory before creating issues","Keep user references in sync with offboarding","Use canonical account emails, not aliases"],"tags":["user-lookup","not-found","email"],"backgroundTag":"user-not-found","analyzedSha":"1870550677fe08f0d2a78c07acd27541464eb945","analyzedAt":"2026-09-06T21:16:13.665Z","contentChangedAt":"2026-09-06T21:16:13.665Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}