{"record":{"id":"d404bef6994be0dd","repo":"grafana/k6","slug":"requesting-presigned-url-w","errorCode":null,"errorMessage":"requesting presigned url: %w","messagePattern":"requesting presigned url: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/storage/file_persister.go","lineNumber":98,"sourceCode":"\tpresignedURLRequestURL string,\n\theaders map[string]string,\n\tbasePath string,\n) *RemoteFilePersister {\n\treturn &RemoteFilePersister{\n\t\tpresignedURLRequestURL: presignedURLRequestURL,\n\t\theaders:                headers,\n\t\tbasePath:               basePath,\n\t\thttpClient: &http.Client{\n\t\t\tTimeout: time.Second * 10,\n\t\t},\n\t}\n}\n\n// Persist will upload the contents of data to a remote location.\nfunc (r *RemoteFilePersister) Persist(ctx context.Context, path string, data io.Reader) (err error) {\n\tpsResp, err := r.requestPresignedURL(ctx, path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"requesting presigned url: %w\", err)\n\t}\n\n\treq, err := newFileUploadRequest(ctx, psResp, data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating upload request: %w\", err)\n\t}\n\n\tresp, err := r.httpClient.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"performing upload request: %w\", err)\n\t}\n\tdefer resp.Body.Close() //nolint:errcheck\n\n\tif _, err := io.Copy(io.Discard, resp.Body); err != nil {\n\t\treturn fmt.Errorf(\"draining upload response body: %w\", err)\n\t}\n\n\tif err := checkStatusCode(resp); err != nil {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/grafana/k6/blob/8d06114777191d21ef885d05c5f8aa9e1ed838ae/internal/js/modules/k6/browser/storage/file_persister.go#L80-L116","documentation":"Raised in RemoteFilePersister.Persist when requestPresignedURL fails: the HTTP POST to the cloud presigned-URL endpoint (with a 10s client timeout) could not be completed. This covers request creation, network transport, status-code rejection, or response-decoding failures — i.e. k6 could not obtain an upload target for the artifact from the remote (cloud) service before any upload is attempted.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/storage/file_persister.go:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify network connectivity and proxy settings to the k6 Cloud endpoint","Check validity of authentication headers/token used for the presigned request","Retry the operation; transient network or 5xx failures are common","Inspect the wrapped error to see if it was transport, status code, or decoding that failed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d06114777191d21ef885d05c5f8aa9e1ed838ae","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}