{"record":{"id":"ec4fe7ad3712ab70","repo":"shadow1ng/fscan","slug":"fscan-at-least-one-target-is-required","errorCode":null,"errorMessage":"fscan: at least one target is required","messagePattern":"fscan: at least one target is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/fscan/scanner.go","lineNumber":335,"sourceCode":"\tcfg.Output.DisableSave = true\n\tcfg.Output.Silent = true\n\tcfg.Output.DisableProgress = true\n\tcfg.Output.ShowProgress = false\n\n\tsession := common.NewScanSession(cfg, state, fv)\n\tsession.ResultSink = sink\n\n\tif opts.controller != nil {\n\t\tsession.PauseGate = opts.controller.pauseGate\n\t\topts.controller.addState(state)\n\t}\n\n\treturn core.RunScan(ctx, info, session)\n}\n\nfunc validateConfig(config Config, targets []Target) error {\n\tif len(targets) == 0 {\n\t\treturn fmt.Errorf(\"fscan: at least one target is required\")\n\t}\n\tfor _, name := range normalizePlugins(config.Plugins) {\n\t\tif !plugins.Exists(name) {\n\t\t\treturn fmt.Errorf(\"fscan: plugin %q not found\", name)\n\t\t}\n\t\tif !config.AllowUnsafePlugins && !IsSafePlugin(name) {\n\t\t\treturn fmt.Errorf(\"fscan: plugin %q is not enabled for embedded safe mode\", name)\n\t\t}\n\t}\n\tfor _, target := range targets {\n\t\tif strings.TrimSpace(target.Host) == \"\" && strings.TrimSpace(target.URL) == \"\" {\n\t\t\treturn fmt.Errorf(\"fscan: target host or URL is required\")\n\t\t}\n\t\tif strings.TrimSpace(target.Host) != \"\" && strings.TrimSpace(target.URL) != \"\" {\n\t\t\treturn fmt.Errorf(\"fscan: target cannot set both Host and URL\")\n\t\t}\n\t\tfor _, port := range target.Ports {\n\t\t\tif port < 1 || port > 65535 {","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/pkg/fscan/scanner.go#L317-L353","documentation":"Top-level validation in pkg/fscan validateConfig: the scanner was started with an empty targets slice, so there is nothing to scan. It fires before plugin and per-target checks and means the caller must supply at least one Target (embedded-API equivalent of running fscan with no host).","triggerScenarios":"Thrown at pkg/fscan/scanner.go:335 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply at least one Target with Host or URL set","Load targets from a file if specifying inline is impractical","Validate target input before constructing the Scanner"],"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"}