{"record":{"id":"5eb1578e67e496d1","repo":"grafana/k6","slug":"failed-to-extract-secret-w","errorCode":null,"errorMessage":"failed to extract secret: %w","messagePattern":"failed to extract secret: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/secretsource/url/url.go","lineNumber":206,"sourceCode":"\t\t\t// Network errors are retryable\n\t\t\treturn fmt.Errorf(\"failed to get secret: %w\", err), true\n\t\t}\n\t\tdefer func() { _ = response.Body.Close() }()\n\n\t\tif response.StatusCode != http.StatusOK {\n\t\t\tstatusErr := fmt.Errorf(\"status code %d: %w\", response.StatusCode, errFailedToGetSecret)\n\n\t\t\t// Retry on server errors (5xx) and rate limiting (429)\n\t\t\t// Don't retry on client errors (4xx except 429)\n\t\t\tretryable := response.StatusCode >= 500 || response.StatusCode == http.StatusTooManyRequests\n\t\t\treturn statusErr, retryable\n\t\t}\n\n\t\t// Extract secret value from response\n\t\textractedSecret, err := extractSecretFromResponse(response.Body, us.config.ResponsePath.String)\n\t\tif err != nil {\n\t\t\t// Extraction errors are not retryable (indicates config issue)\n\t\t\treturn fmt.Errorf(\"failed to extract secret: %w\", err), false\n\t\t}\n\n\t\tsecret = extractedSecret\n\t\treturn nil, false\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn secret, nil\n}\n\ntype limiter interface {\n\tWait(ctx context.Context) error\n}\n\nfunc newLimiter(requestsPerMinuteLimit, requestsBurst int) *rate.Limiter {\n\t// The calculation below looks wrong because it seems like it's giving","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/secretsource/url/url.go#L188-L224","documentation":"After a 200 response, extracting the secret from the body failed — reading the body or resolving the configured responsePath. The extraction step wraps its own error; see the cause for whether it was a read or path problem.","triggerScenarios":"Thrown at internal/secretsource/url/url.go:206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error: 'path not found' means the responsePath doesn't match the JSON; read errors mean connection issues","Verify responsePath (a gjson path) against the actual service response","Omit responsePath if the whole body is the secret"],"exampleFix":null,"handlingStrategy":"fallback","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"}