grafana/k6 · error
test run aborted before starting: %s
Error message
test run aborted before starting: %s
What it means
While WaitForTestRunReady polls, a transition to status 'aborted' (internal/cloudapi/provisioning/api.go:154-163) means the cloud backend aborted the run before k6 could start executing locally. The code scans status history for the most recent abort message and includes it, so the suffix (e.g. 'VUh quota exceeded', 'test validation failed', 'aborted by user') is the backend's own reason.
Source
Thrown at internal/cloudapi/provisioning/api.go:162
return fmt.Errorf("fetching test status: %w", err)
}
status := progress.Status.String()
switch v6.Status(status) {
case v6.StatusInitializing:
return nil
case v6.StatusAborted:
var abortMsg string
for _, e := range progress.StatusHistory {
if e.Status == v6.StatusAborted && e.Message != "" {
abortMsg = e.Message
break
}
}
if abortMsg != "" {
return fmt.Errorf("test run aborted before starting: %s", abortMsg)
}
return fmt.Errorf("test run aborted before starting")
case v6.StatusCompleted:
return fmt.Errorf("test run completed before k6 could start")
default:
// created, queued, or any unrecognised state — keep polling.
if status != lastStatus {
c.logger.WithField("status", progress.FormatStatus()).Debug("test status")
lastStatus = status
}
}
select {
case <-ctx.Done():
return ctx.Err()
case <-time.After(pollInterval):View on GitHub (pinned to 93accf6570)
Solutions
- Act on the quoted message: quota-related -> raise the plan/limits or reduce MaxVUs/duration; validation -> fix the reported option; user abort -> coordinate
- Open the test run page in Grafana Cloud k6 (the URL returned at provisioning) for the full abort history
- Re-run once the underlying cause is addressed - a new run is required, the aborted one cannot be resumed
Example fix
# before - exceeding plan limits export K6_VUS=5000 # plan allows 500 k6 cloud run --local-execution script.js # aborted: VUh quota exceeded # after export K6_VUS=500 k6 cloud run --local-execution script.js
Defensive patterns
Strategy: validation
Validate before calling
# before scaling up, check the message the run will be judged on
# keep requested VUs/duration inside the org's plan limits
python3 - <<'EOF'
import os
vus, dur_s = int(os.environ.get('K6_VUS', '1')), int(os.environ.get('K6_DURATION_S', '60'))
assert vus * dur_s <= int(os.environ.get('ORG_MAX_VUH', '500')) * 3600, 'request exceeds VUh quota'
EOF Try / catch
if err := client.WaitForTestRunReady(ctx, id, 0); err != nil {
if strings.Contains(err.Error(), "test run aborted before starting") {
// the suffix is the backend's reason (quota/validation/user abort):
// fix that cause, then start a NEW run - the aborted one cannot be resumed
}
} Prevention
- Keep MaxVUs and duration within the organization's plan before launching
- Watch the run's page in Grafana Cloud k6 when aborts recur - status history gives the authoritative reason
- Coordinate with anyone who can abort runs so queued tests are not cancelled as 'stuck'
When it happens
Trigger: Cloud-side validation rejecting the submitted options; organization quota/plan limits (max VUs, VUh budget) exceeded at provisioning time; a user or automation aborting the run from the Grafana Cloud k6 UI while it was still queued; org policy blocking the test.
Common situations: Scaling a test up past the plan's limits; a first run in an org with no remaining VUh allowance; someone clicking Stop/Abort on a queued run they thought was stuck.
Related errors
- creating upload request: %w
- test run aborted before starting
- Run `k6 cloud login` to authenticate, or check the docs for
- access token not configured
- no project specified. Use --project-id, set K6_CLOUD_PROJECT
AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15).
Data as JSON: /api/errors/031a0fdd49103a9c.
Report an issue: GitHub.