{"record":{"id":"1b29e6123d3c0c4a","repo":"grafana/k6","slug":"path-q-not-found-in-response","errorCode":null,"errorMessage":"path %q not found in response","messagePattern":"path %q not found in response","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/secretsource/url/url.go","lineNumber":256,"sourceCode":"\tlimitedReader := io.LimitReader(body, maxSecretSize+1)\n\tdata, err := io.ReadAll(limitedReader)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to read response body: %w\", err)\n\t}\n\n\tif len(data) > maxSecretSize {\n\t\treturn \"\", fmt.Errorf(\"secret response exceeds maximum size of %d bytes\", maxSecretSize)\n\t}\n\n\tif responsePath == \"\" {\n\t\t// If no path specified, assume response body is the secret\n\t\treturn string(data), nil\n\t}\n\n\tresult := gjson.GetBytes(data, responsePath)\n\n\tif !result.Exists() {\n\t\treturn \"\", fmt.Errorf(\"path %q not found in response\", responsePath)\n\t}\n\n\tif result.Type != gjson.String {\n\t\treturn \"\", fmt.Errorf(\"secret value at path %q is not a string (got %s)\", responsePath, result.Type)\n\t}\n\n\treturn result.String(), nil\n}\n\n// retry retries to execute a provided function until it succeeds or the maximum\n// number of attempts is hit. It waits with exponential backoff between attempts.\n// The backoff calculation is: wait = (base ^ attempt) + random jitter up to 1 second.\n// The do function returns an error and a boolean indicating if the error is retryable.\nfunc retry(\n\tctx context.Context,\n\tattempts int,\n\tbaseBackoff time.Duration,\n\tlogger logrus.FieldLogger,","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/secretsource/url/url.go#L238-L274","documentation":"After reading the body, extractSecretFromResponse applies the configured responsePath as a gjson path into the (JSON) response. This error means the path matched nothing — wrong path syntax or a response shape that does not contain that key — so no secret value could be located.","triggerScenarios":"Thrown at internal/secretsource/url/url.go:256 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct responsePath to a valid gjson path present in the response, e.g. data.values.mysecret","Inspect an actual response body to find the correct field","Omit responsePath if the whole body is the secret"],"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"}