{"record":{"id":"989add603c810081","repo":"shadow1ng/fscan","slug":"config-read-passwords-failed","errorCode":"config_read_passwords_failed","errorMessage":"%s","messagePattern":"%s","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/config_builder.go","lineNumber":147,"sourceCode":"func parsePasswords(fv *FlagVars) ([]string, error) {\n\tvar passwords []string\n\n\t// 命令行密码（支持逗号分隔多个值，保留空格作为密码的一部分）\n\tif fv.Password != \"\" {\n\t\tfor _, p := range strings.Split(fv.Password, \",\") {\n\t\t\tp = strings.TrimSpace(p)\n\t\t\tif p != \"\" {\n\t\t\t\tpasswords = append(passwords, p)\n\t\t\t}\n\t\t}\n\t}\n\n\t// 从文件读取\n\tif fv.PasswordsFile != \"\" {\n\t\tif lines, err := parsers.ReadLinesFromFile(fv.PasswordsFile); err == nil {\n\t\t\tpasswords = append(passwords, lines...)\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"%s\", i18n.Tr(\"config_read_passwords_failed\", fv.PasswordsFile, err))\n\t\t}\n\t}\n\n\t// 额外密码\n\tif fv.AddPasswords != \"\" {\n\t\tpasswords = append(passwords, splitCredentialValues(fv.AddPasswords)...)\n\t}\n\n\treturn removeDuplicate(passwords), nil\n}\n\nfunc splitCredentialValues(input string) []string {\n\tfields := strings.FieldsFunc(input, func(r rune) bool {\n\t\treturn r == ',' || r == ' ' || r == '\\t' || r == '\\n' || r == '\\r'\n\t})\n\n\tvalues := make([]string, 0, len(fields))\n\tfor _, field := range fields {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/common/config_builder.go#L129-L165","documentation":"Raised in parsePasswords when reading the -pwdf passwords file fails (missing, unreadable, or I/O error); the localized message carries the file path and wrapped cause. Only file reading, not password content, triggers it.","triggerScenarios":"Thrown at common/config_builder.go:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the passwords file path is correct and readable","Ensure one password per line with no binary content","Use -pw to supply passwords inline as a workaround"],"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"}