{"record":{"id":"05051b9a743efd8e","repo":"shadow1ng/fscan","slug":"config-credentials-parse-failed","errorCode":"config_credentials_parse_failed","errorMessage":"%s: %w","messagePattern":"%s: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/config_builder.go","lineNumber":33,"sourceCode":"\n/*\nconfig_builder.go - 统一配置构建入口\n\n从 FlagVars 直接构建 Config 和 State，消除中间层。\n*/\n\n// BuildConfig 从 FlagVars 构建完整的 Config 和 State\n// 这是新的统一入口，替代原来的 Parse() + BuildConfigFromFlags() + updateGlobalVariables()\nfunc BuildConfig(fv *FlagVars, info *HostInfo) (*Config, *State, error) {\n\t// 1. 构建基础 Config（从 flag_config.go 的 BuildConfigFromFlags）\n\tcfg := BuildConfigFromFlags(fv)\n\n\t// 2. 创建 State\n\tstate := NewState()\n\n\t// 3. 解析凭据\n\tif err := parseCredentials(fv, cfg); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"config_credentials_parse_failed\"), err)\n\t}\n\n\t// 4. 解析目标（主机、端口、URL）\n\tif err := parseTargets(fv, info, cfg, state); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"%s: %w\", i18n.GetText(\"config_targets_parse_failed\"), err)\n\t}\n\n\t// 5. 应用日志级别\n\tapplyLogLevelFromConfig(fv)\n\n\treturn cfg, state, nil\n}\n\n// =============================================================================\n// 凭据解析\n// =============================================================================\n\nfunc parseCredentials(fv *FlagVars, cfg *Config) error {","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/common/config_builder.go#L15-L51","documentation":"Wrapper in BuildConfig: parseCredentials (parsing -user/-usersfile/-pass/-pwdf/-hash etc.) failed; the localized 'config_credentials_parse_failed' prefix is joined with the underlying error to show which credential input was bad.","triggerScenarios":"Thrown at common/config_builder.go:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error to find the offending flag or file","Verify user/password/hash files exist and are readable","Fix the malformed hash or credential format and rerun"],"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"}