{"record":{"id":"031a0fdd49103a9c","repo":"grafana/k6","slug":"test-run-aborted-before-starting-s","errorCode":null,"errorMessage":"test run aborted before starting: %s","messagePattern":"test run aborted before starting: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloudapi/provisioning/api.go","lineNumber":162,"sourceCode":"\t\t\treturn fmt.Errorf(\"fetching test status: %w\", err)\n\t\t}\n\n\t\tstatus := progress.Status.String()\n\n\t\tswitch v6.Status(status) {\n\t\tcase v6.StatusInitializing:\n\t\t\treturn nil\n\n\t\tcase v6.StatusAborted:\n\t\t\tvar abortMsg string\n\t\t\tfor _, e := range progress.StatusHistory {\n\t\t\t\tif e.Status == v6.StatusAborted && e.Message != \"\" {\n\t\t\t\t\tabortMsg = e.Message\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif abortMsg != \"\" {\n\t\t\t\treturn fmt.Errorf(\"test run aborted before starting: %s\", abortMsg)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"test run aborted before starting\")\n\n\t\tcase v6.StatusCompleted:\n\t\t\treturn fmt.Errorf(\"test run completed before k6 could start\")\n\n\t\tdefault:\n\t\t\t// created, queued, or any unrecognised state — keep polling.\n\t\t\tif status != lastStatus {\n\t\t\t\tc.logger.WithField(\"status\", progress.FormatStatus()).Debug(\"test status\")\n\t\t\t\tlastStatus = status\n\t\t\t}\n\t\t}\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\tcase <-time.After(pollInterval):","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cloudapi/provisioning/api.go#L144-L180","documentation":"Returned by Client.WaitForTestRunReady (internal/cloudapi/provisioning/api.go:162) when the polled test run reaches status 'aborted' before ever becoming 'initializing', and the status_history contains an aborted entry with a non-empty message. The %s is that backend message: it is the cloud side telling you why the run was killed while queued/created (quota, limits, manual abort, validation). This is a terminal condition — polling stops immediately.","triggerScenarios":"Cloud-side abort of a queued run: organization monthly VU-hours or test-run quota exceeded, credit/billing limit hit, a user clicking Abort in the Grafana Cloud UI before execution started, or backend-side validation rejecting the configuration.","commonSituations":"CI runs burning the last of a free-tier quota; billing hold on the org; a teammate aborting what looked like a stuck queued run; peak-hour queue backlog followed by a policy abort.","solutions":["Read the message after the colon — it is verbatim from the cloud status_history and names the actual cause (e.g. 'quota exceeded').","Check the org's usage/quotas and billing state in Grafana Cloud; increase limits or wait for the window to reset.","Open the test run's page (URL printed earlier in the log) and inspect its event timeline for who/what aborted it.","If the message is opaque, capture the test run ID and contact k6 Cloud support with it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := c.WaitForTestRunReady(ctx, testRunID, poll); err != nil {\n\tvar abortMsg string\n\tif strings.HasPrefix(err.Error(), \"test run aborted before starting: \") {\n\t\tabortMsg = strings.TrimPrefix(err.Error(), \"test run aborted before starting: \")\n\t\t// surface to CI as a quota/policy failure, not a code bug\n\t\treturn fmt.Errorf(\"cloud aborted the queued run: %s\", abortMsg)\n\t}\n\treturn err\n}","preventionTips":["Monitor org VU-hour/test-run quotas before launching scheduled CI tests.","Coordinate with the team so only one automation stream aborts runs in a shared project.","Treat any 'aborted before starting' as a signal to check the Grafana Cloud project page first."],"tags":["k6","cloud","provisioning","test-run","aborted","quota"],"backgroundTag":"test-run-aborted","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"}