{"record":{"id":"b6824c4a1a2bf1c2","repo":"shadow1ng/fscan","slug":"config-read-urls-failed","errorCode":"config_read_urls_failed","errorMessage":"%s","messagePattern":"%s","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/config_builder.go","lineNumber":294,"sourceCode":"\n\t// 命令行 URL\n\tif fv.TargetURL != \"\" {\n\t\tfor _, u := range strings.Split(fv.TargetURL, \",\") {\n\t\t\tu = strings.TrimSpace(u)\n\t\t\tif u != \"\" {\n\t\t\t\turls = append(urls, normalizeURL(u))\n\t\t\t}\n\t\t}\n\t}\n\n\t// 从文件读取\n\tif fv.URLsFile != \"\" {\n\t\tif lines, err := parsers.ReadLinesFromFile(fv.URLsFile); err == nil {\n\t\t\tfor _, line := range lines {\n\t\t\t\turls = append(urls, normalizeURL(line))\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"%s\", i18n.Tr(\"config_read_urls_failed\", fv.URLsFile, err))\n\t\t}\n\t}\n\n\treturn removeDuplicate(urls), nil\n}\n\nfunc normalizeURL(rawURL string) string {\n\trawURL = strings.TrimSpace(rawURL)\n\tif rawURL == \"\" {\n\t\treturn rawURL\n\t}\n\tlowerURL := strings.ToLower(rawURL)\n\tif !strings.HasPrefix(lowerURL, \"http://\") && !strings.HasPrefix(lowerURL, \"https://\") {\n\t\treturn \"http://\" + normalizeSchemelessURLTarget(rawURL)\n\t}\n\tparsed, err := url.Parse(rawURL)\n\tif err != nil || parsed.Host == \"\" {\n\t\treturn rawURL","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/common/config_builder.go#L276-L312","documentation":"Wrapping error from parseURLs: reading the URL list file (fv.URLsFile) via parsers.ReadLinesFromFile failed, and the underlying error is reported through the i18n message config_read_urls_failed with the file path and cause. It fires only in the file branch, never for command-line URLs (those are silently skipped if empty).","triggerScenarios":"Thrown at common/config_builder.go:294 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the URL list file exists and is readable","Ensure one URL per line","Pass a single URL via -u as a fallback"],"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-14T05:17:10.506Z"}