{"record":{"id":"39fd6f795e2f0d74","repo":"shadow1ng/fscan","slug":"config-targets-parse-failed","errorCode":"config_targets_parse_failed","errorMessage":"%s: %w","messagePattern":"%s: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/config_builder.go","lineNumber":38,"sourceCode":"*/\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 {\n\t// 解析用户名\n\tusernames, err := parseUsernames(fv)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/common/config_builder.go#L20-L56","documentation":"Wrapper in BuildConfig: parseTargets failed while resolving -h/-hf hosts, -p ports, and -u/-uf URL targets into the scan target set; the localized 'config_targets_parse_failed'-style prefix is joined with the underlying cause.","triggerScenarios":"Thrown at common/config_builder.go:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check host/URL target files exist and contain valid entries","Fix CIDR/IP-range syntax in the -h argument","Inspect the wrapped error for the specific target that failed"],"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"}