{"record":{"id":"9feae7f04b5262f0","repo":"grafana/k6","slug":"performing-upload-request-w","errorCode":null,"errorMessage":"performing upload request: %w","messagePattern":"performing upload request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/storage/file_persister.go","lineNumber":108,"sourceCode":"\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) //nolint:gosec\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 {\n\t\treturn fmt.Errorf(\"uploading: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// requestPresignedURL will request a new presigned URL from the remote server\n// and returns a [PresignedURLResponse] that contains the presigned URL details.\nfunc (r *RemoteFilePersister) requestPresignedURL(ctx context.Context, path string) (PresignedURLResponse, error) {\n\tb, err := buildPresignedRequestBody(r.basePath, path)","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/storage/file_persister.go#L90-L126","documentation":"Raised in RemoteFilePersister.Persist when httpClient.Do fails to execute the already-built multipart upload request against the presigned URL. This is a transport-level failure of the actual artifact upload: connection refused/reset, TLS errors, DNS failure, or the 10-second client timeout expiring before the upload completes.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/storage/file_persister.go:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network stability and bandwidth to the storage endpoint","Retry the upload; presigned uploads are idempotent when re-requested","Increase reliability by reducing artifact size (e.g. lower screenshot frequency)","Inspect the wrapped transport error for timeout vs connection failure"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}