grafana/k6 · error
creating request: %w
Error message
creating request: %w
What it means
Raised in requestPresignedURL when http.NewRequestWithContext fails to build the POST request to the presigned-URL endpoint from the JSON body. Since the URL comes from configuration, this fires when the configured presignedURLRequestURL is not a valid/parseable URL (bad scheme, control characters) or the context is already canceled — a configuration-level failure rather than a network one.
Source
Thrown at internal/js/modules/k6/browser/storage/file_persister.go:138
return nil
}
// requestPresignedURL will request a new presigned URL from the remote server
// and returns a [PresignedURLResponse] that contains the presigned URL details.
func (r *RemoteFilePersister) requestPresignedURL(ctx context.Context, path string) (PresignedURLResponse, error) {
b, err := buildPresignedRequestBody(r.basePath, path)
if err != nil {
return PresignedURLResponse{}, fmt.Errorf("building request body: %w", err)
}
req, err := http.NewRequestWithContext(
ctx,
http.MethodPost,
r.presignedURLRequestURL,
bytes.NewReader(b),
)
if err != nil {
return PresignedURLResponse{}, fmt.Errorf("creating request: %w", err)
}
for k, v := range r.headers {
req.Header.Add(k, v)
}
resp, err := r.httpClient.Do(req) //nolint:gosec
if err != nil {
return PresignedURLResponse{}, fmt.Errorf("performing request: %w", err)
}
defer resp.Body.Close() //nolint:errcheck
if err := checkStatusCode(resp); err != nil {
return PresignedURLResponse{}, err
}
return readPresignedURLResponse(resp)
}View on GitHub (pinned to 01ffac6f24)
Solutions
- Check the cloud/presigned endpoint URL configuration for typos or invalid characters
- Ensure the URL has a valid scheme (https://)
- Verify the execution context is not already canceled before uploading artifacts
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/js/modules/k6/browser/storage/file_persister.go:138 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/2ece2f7d8e1aa5e6.
Report an issue: GitHub.