{"record":{"id":"cc76b0ac48f4fe92","repo":"grafana/k6","slug":"uploading-w","errorCode":null,"errorMessage":"uploading: %w","messagePattern":"uploading: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/storage/file_persister.go","lineNumber":117,"sourceCode":"\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)\n\tif err != nil {\n\t\treturn PresignedURLResponse{}, fmt.Errorf(\"building request body: %w\", err)\n\t}\n\n\treq, err := http.NewRequestWithContext(\n\t\tctx,\n\t\thttp.MethodPost,\n\t\tr.presignedURLRequestURL,\n\t\tbytes.NewReader(b),","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/storage/file_persister.go#L99-L135","documentation":"Raised in RemoteFilePersister.Persist when checkStatusCode rejects the upload response: the presigned-URL upload endpoint returned an HTTP status outside 2xx after the body was successfully drained. The wrapped error names the status code and reason text. This means the remote storage service refused the upload — expired presigned URL, signature mismatch, oversized payload, or server-side failure.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/storage/file_persister.go:117 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the whole persist to obtain a fresh presigned URL (they expire)","Verify authentication headers and cloud credentials are valid","Check artifact size limits imposed by the storage service","Examine the status text in the wrapped error (403=expired/signed URL issue, 413=too large, 5xx=server side)"],"exampleFix":null,"handlingStrategy":"retry","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"}