{"record":{"id":"b1f06099c550da50","repo":"projectdiscovery/subfinder","slug":"threads-cannot-be-zero","errorCode":null,"errorMessage":"threads cannot be zero","messagePattern":"threads cannot be zero","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runner/validate.go","lineNumber":32,"sourceCode":"\tsliceutil \"github.com/projectdiscovery/utils/slice\"\n)\n\n// validateOptions validates the configuration options passed\nfunc (options *Options) validateOptions() error {\n\t// Check if domain, list of domains, or stdin info was provided.\n\t// If none was provided, then return.\n\tif len(options.Domain) == 0 && options.DomainsFile == \"\" && !options.Stdin {\n\t\treturn errors.New(\"no input list provided\")\n\t}\n\n\t// Both verbose and silent flags were used\n\tif options.Verbose && options.Silent {\n\t\treturn errors.New(\"both verbose and silent mode specified\")\n\t}\n\n\t// Validate threads and options\n\tif options.Threads == 0 {\n\t\treturn errors.New(\"threads cannot be zero\")\n\t}\n\tif options.Timeout == 0 {\n\t\treturn errors.New(\"timeout cannot be zero\")\n\t}\n\n\t// Always remove wildcard with hostip\n\tif options.HostIP && !options.RemoveWildcard {\n\t\treturn errors.New(\"hostip flag must be used with RemoveWildcard option\")\n\t}\n\n\t// The per-source results limit cannot be negative.\n\tif options.MaxResults < 0 {\n\t\treturn fmt.Errorf(\"max-results cannot be negative\")\n\t}\n\n\t// The response body size limit cannot be negative.\n\tif options.MaxResponseBodySize < 0 {\n\t\treturn fmt.Errorf(\"response-size-read cannot be negative\")","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/projectdiscovery/subfinder/blob/7a0b91f0fac01b62c65328bd771a3560ae611d6a/pkg/runner/validate.go#L14-L50","documentation":"Sanity check in Options.validateOptions: the -t/--threads value resolved to zero (unset or explicitly 0), which would give the enumeration worker pool no goroutines. The zero value is rejected so the runner can fall back to or demand a positive concurrency setting.","triggerScenarios":"Thrown at pkg/runner/validate.go:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a positive thread count, e.g. -t 10 (the flag's default when properly bound)","If building Options programmatically, populate options.Threads with a positive default before calling validateOptions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a0b91f0fac01b62c65328bd771a3560ae611d6a","analyzedAt":"2026-09-06T23:52:02.109Z","contentChangedAt":"2026-09-06T23:52:02.109Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}