{"record":{"id":"32f1f59172896d65","repo":"projectdiscovery/subfinder","slug":"timeout-cannot-be-zero","errorCode":null,"errorMessage":"timeout cannot be zero","messagePattern":"timeout cannot be zero","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runner/validate.go","lineNumber":35,"sourceCode":"// 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\")\n\t}\n\n\tif options.Match != nil {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/projectdiscovery/subfinder/blob/7a0b91f0fac01b62c65328bd771a3560ae611d6a/pkg/runner/validate.go#L17-L53","documentation":"Sanity check in Options.validateOptions: the -timeout value per source query is zero (unset or explicitly 0), which would make every passive-source HTTP request fail or hang immediately. A positive timeout is required before enumeration begins.","triggerScenarios":"Thrown at pkg/runner/validate.go:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a positive timeout such as -timeout 30 (seconds)","When constructing Options in code, default options.Timeout to a positive value before validation"],"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"}