{"record":{"id":"9d9ce8e3d848dc36","repo":"shadow1ng/fscan","slug":"config-read-users-failed","errorCode":"config_read_users_failed","errorMessage":"%s","messagePattern":"%s","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/config_builder.go","lineNumber":112,"sourceCode":"func parseUsernames(fv *FlagVars) ([]string, error) {\n\tvar usernames []string\n\n\t// 命令行用户名\n\tif fv.Username != \"\" {\n\t\tfor _, u := range strings.Split(fv.Username, \",\") {\n\t\t\tu = strings.TrimSpace(u)\n\t\t\tif u != \"\" {\n\t\t\t\tusernames = append(usernames, u)\n\t\t\t}\n\t\t}\n\t}\n\n\t// 从文件读取\n\tif fv.UsersFile != \"\" {\n\t\tif lines, err := parsers.ReadLinesFromFile(fv.UsersFile); err == nil {\n\t\t\tusernames = append(usernames, lines...)\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"%s\", i18n.Tr(\"config_read_users_failed\", fv.UsersFile, err))\n\t\t}\n\t}\n\n\t// 额外用户名\n\tif fv.AddUsers != \"\" {\n\t\tfor _, u := range strings.Split(fv.AddUsers, \",\") {\n\t\t\tu = strings.TrimSpace(u)\n\t\t\tif u != \"\" {\n\t\t\t\tusernames = append(usernames, u)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn removeDuplicate(usernames), nil\n}\n\nfunc parsePasswords(fv *FlagVars) ([]string, error) {\n\tvar passwords []string","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/common/config_builder.go#L94-L130","documentation":"Raised in parseUsernames when reading the -usersfile file fails (missing, unreadable, or I/O error); the localized message includes the file path and underlying error. Command-line usernames themselves cannot trigger it.","triggerScenarios":"Thrown at common/config_builder.go:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the users file path exists and is readable","Check file encoding — it must be line-separated plain text","Pass users inline via -user if the file is unavailable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}