{"record":{"id":"63198f6c1a1de213","repo":"grafana/k6","slug":"timeout-must-be-greater-than-0","errorCode":null,"errorMessage":"timeout must be greater than 0","messagePattern":"timeout must be greater than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/secretsource/url/url.go","lineNumber":583,"sourceCode":"\t\tconfig = config.Apply(explicitCfg)\n\t}\n\n\t// Validate the final config\n\tif err := validateConfig(config); err != nil {\n\t\treturn extConfig{}, err\n\t}\n\n\treturn config, nil\n}\n\nfunc validateConfig(config extConfig) error {\n\t// Validate required fields and value constraints\n\tif err := validateURLTemplate(config.URLTemplate); err != nil {\n\t\treturn err\n\t}\n\n\tif config.Timeout.Duration <= 0 {\n\t\treturn errors.New(\"timeout must be greater than 0\")\n\t}\n\n\tif config.RequestsPerMinuteLimit.Int64 <= 0 {\n\t\treturn errors.New(\"requestsPerMinuteLimit must be greater than 0\")\n\t}\n\n\tif config.RequestsBurst.Int64 <= 0 {\n\t\treturn errors.New(\"requestsBurst must be greater than 0\")\n\t}\n\n\tif config.MaxRetries.Int64 < 0 {\n\t\treturn errors.New(\"maxRetries must be non-negative\")\n\t}\n\n\tif config.RetryBackoff.Duration <= 0 {\n\t\treturn errors.New(\"retryBackoff must be greater than 0\")\n\t}\n","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/secretsource/url/url.go#L565-L601","documentation":"validateConfig() requires the url secret source's HTTP client timeout to be strictly positive. A zero or negative duration (including ones produced by '0s' or '-5s') fails startup immediately. Since newConfig() supplies a sane default, this error only appears when the timeout is explicitly overridden to a non-positive value.","triggerScenarios":"Setting K6_SECRET_SOURCE_URL_TIMEOUT='0s' (or a negative duration), or a JSON/inline config with \"timeout\": \"0s\" / negative duration; the override survives the Apply() merge and fails validateConfig().","commonSituations":"Trying to disable the timeout by setting it to 0; unit tests that zero out all fields; a config file that enumerates every field with placeholder zeros.","solutions":["Remove the timeout override so the built-in default applies","Or set a positive value such as K6_SECRET_SOURCE_URL_TIMEOUT='30s'","Scan the JSON config file and environment for 'timeout' entries set to 0 or negative durations"],"exampleFix":"# before\nK6_SECRET_SOURCE_URL_TIMEOUT='0s'\n\n# after\nK6_SECRET_SOURCE_URL_TIMEOUT='30s'","handlingStrategy":"validation","validationCode":"const t = Number(process.env.K6_SECRET_SOURCE_URL_TIMEOUT?.replace(/s$/, ''));\nif (process.env.K6_SECRET_SOURCE_URL_TIMEOUT && t <= 0) {\n  throw new Error('timeout must be > 0');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not set timeout to 0 expecting 'no timeout'; omit it to use the default","Validate numeric env overrides in a preflight script","Keep zeroed config scaffolds out of production"],"tags":["config","secrets","timeout","validation","startup"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}