{"record":{"id":"29791fc822e18c7d","repo":"goharbor/harbor","slug":"multiple-entries-found-for-username-s","errorCode":null,"errorMessage":"multiple entries found for username: %s","messagePattern":"multiple entries found for username: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"src/core/auth/uaa/uaa.go","lineNumber":118,"sourceCode":"\t\tlog.Warningf(\"Failed to update user profile, user: %s, error: %v\", user.Username, err2)\n\t}\n\treturn nil\n}\n\n// SearchUser search user on uaa server, transform it to Harbor's user model\nfunc (u *Auth) SearchUser(ctx context.Context, username string) (*models.User, error) {\n\tif err := u.ensureClient(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\tl, err := u.client.SearchUser(username)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(l) == 0 {\n\t\treturn nil, nil\n\t}\n\tif len(l) > 1 {\n\t\treturn nil, fmt.Errorf(\"multiple entries found for username: %s\", username)\n\t}\n\te := l[0]\n\temail := \"\"\n\tif len(e.Emails) > 0 {\n\t\temail = e.Emails[0].Value\n\t}\n\treturn &models.User{\n\t\tUsername: username,\n\t\tEmail:    email,\n\t}, nil\n}\n\nfunc (u *Auth) ensureClient(ctx context.Context) error {\n\tvar cfg *uaa.ClientConfig\n\tUAASettings, err := config.UAASettings(ctx)\n\t//\tlog.Debugf(\"Uaa settings: %+v\", UAASettings)\n\tif err != nil {\n\t\tlog.Warningf(\"Failed to get UAA setting from Admin Server, error: %v\", err)","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/core/auth/uaa/uaa.go#L100-L136","documentation":"Error \"multiple entries found for username: %s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/core/auth/uaa/uaa.go:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}