{"record":{"id":"76a04919838ccb6a","repo":"apache/answer","slug":"user-not-found-s","errorCode":null,"errorMessage":"user not found: %s","messagePattern":"user not found: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cli/reset_password.go","lineNumber":118,"sourceCode":"\tauthSvc := authService.NewAuthService(authRepo, apiKeyRepo)\n\n\temail := strings.TrimSpace(opts.Email)\n\tif email == \"\" {\n\t\treader := bufio.NewReader(os.Stdin)\n\t\tfmt.Print(\"Please input user email: \")\n\t\temailInput, err := reader.ReadString('\\n')\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"read email input failed: %w\", err)\n\t\t}\n\t\temail = strings.TrimSpace(emailInput)\n\t}\n\n\tuserInfo, exist, err := userRepo.GetByEmail(ctx, email)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"query user failed: %w\", err)\n\t}\n\tif !exist {\n\t\treturn fmt.Errorf(\"user not found: %s\", email)\n\t}\n\n\tfmt.Printf(\"You are going to reset password for user: %s\\n\", email)\n\n\tpassword := strings.TrimSpace(opts.Password)\n\n\tif password != \"\" {\n\t\tprintWarning(\"Passing password via command line may be recorded in shell history\")\n\t\tif err := checker.CheckPassword(password); err != nil {\n\t\t\treturn fmt.Errorf(\"password validation failed: %w\", err)\n\t\t}\n\t} else {\n\t\tpassword, err = promptForPassword()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"password input failed: %w\", err)\n\t\t}\n\t}\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/answer/blob/3b9f1370612e690a0b7f230f05e688930db4c6d3/internal/cli/reset_password.go#L100-L136","documentation":"Fires in ResetPassword when userRepo.GetByEmail returns exist=false for the given email, meaning no user account matches the email typed at the prompt or passed via --email. It is a plain fmt.Errorf sentinel raised on a validation-style guard against a wrong/typo'd email address.","triggerScenarios":"Thrown at internal/cli/reset_password.go:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the email address was typed correctly and matches an existing account","Check the database for the user with a direct query (SELECT from users WHERE email = ...) to confirm the record exists","If the user truly does not exist, create the account first or use the admin user-creation flow instead of resetting a password","Confirm the CLI is pointed at the correct database/environment connection string"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3b9f1370612e690a0b7f230f05e688930db4c6d3","analyzedAt":"2026-09-05T18:18:39.533Z","contentChangedAt":"2026-09-05T18:18:39.533Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}