{"record":{"id":"48f5d19084b73909","repo":"grafana/k6","slug":"invalid-timeout-value-w-48f5d1","errorCode":null,"errorMessage":"invalid timeout value: %w","messagePattern":"invalid timeout value: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"js/modules/k6/http/request.go","lineNumber":402,"sourceCode":"\t\t\t\t\talgo = strings.TrimSpace(algo)\n\t\t\t\t\tresult.Compressions[index], err = httpext.CompressionTypeString(algo)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"unknown compression algorithm %s, supported algorithms are %s\",\n\t\t\t\t\t\t\talgo, httpext.CompressionTypeValues())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase \"redirects\":\n\t\t\t\tresult.Redirects = null.IntFrom(params.Get(k).ToInteger())\n\t\t\tcase \"tags\":\n\t\t\t\tif err := common.ApplyCustomUserTags(rt, &result.TagsAndMeta, params.Get(k)); err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"invalid HTTP request metric tags: %w\", err)\n\t\t\t\t}\n\t\t\tcase \"auth\":\n\t\t\t\tresult.Auth = params.Get(k).String()\n\t\t\tcase \"timeout\":\n\t\t\t\tt, err := types.GetDurationValue(params.Get(k).Export())\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"invalid timeout value: %w\", err)\n\t\t\t\t}\n\t\t\t\tresult.Timeout = t\n\t\t\tcase \"throw\":\n\t\t\t\tresult.Throw = params.Get(k).ToBoolean()\n\t\t\tcase \"responseType\":\n\t\t\t\tresponseType, err := httpext.ResponseTypeString(params.Get(k).String())\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tresult.ResponseType = responseType\n\t\t\tcase \"responseCallback\":\n\t\t\t\tv := params.Get(k).Export()\n\t\t\t\tif v == nil {\n\t\t\t\t\tresult.ResponseCallback = nil\n\t\t\t\t} else if c, ok := v.(*expectedStatuses); ok {\n\t\t\t\t\tresult.ResponseCallback = c.match\n\t\t\t\t} else {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unsupported responseCallback\")","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/js/modules/k6/http/request.go#L384-L420","documentation":"Also in parseRequest's params loop: the timeout value given in the request params could not be converted/validated as a valid duration, so the request setup fails. The user supplied a timeout of the wrong type or format in the params argument to an http method.","triggerScenarios":"Thrown at js/modules/k6/http/request.go:402 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid Go duration string, e.g. timeout: '30s' or '2m'","Check for missing unit suffixes (bare numbers are invalid)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}