{"record":{"id":"33663d95a54cf29b","repo":"grafana/k6","slug":"test-run-aborted-before-starting","errorCode":null,"errorMessage":"test run aborted before starting","messagePattern":"test run aborted before starting","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloudapi/provisioning/api.go","lineNumber":164,"sourceCode":"\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):\n\t\t\t// continue polling\n\t\t}","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/cloudapi/provisioning/api.go#L146-L182","documentation":"Identical state machine to the messaged variant: the provisioned test run reached 'aborted' before 'initializing', but no entry in status history carried a message (internal/cloudapi/provisioning/api.go:164), so k6 can only report the bare fact. The abort happened backend-side (API-triggered aborts and some internal aborts leave no message), and the reason must be retrieved out-of-band.","triggerScenarios":"The run aborted via the cloud API without a human-readable reason; backend-internal aborts (scheduling failures, maintenance) that record no message; status history not yet propagated when k6 polled.","commonSituations":"Automation aborting runs by ID; org-level operations cancelling in-flight provisioning; backend incidents.","solutions":["Open the test run page in Grafana Cloud k6 - the TestRunDetailsPageURL returned at provisioning points at it - and read the status timeline","Query GET /cloud/v6/test_runs/{id} yourself and inspect status_history for context","Re-run the test; if aborts recur with no message, check the Grafana Cloud status page and contact support with the run ID"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := client.WaitForTestRunReady(ctx, id, 0); err != nil {\n    if err.Error() == \"test run aborted before starting\" {\n        // no message recorded: fall back to out-of-band inspection -\n        // GET /cloud/v6/test_runs/{id} status_history, or the run page URL\n        // returned at provisioning - before deciding next steps\n    }\n}","preventionTips":["Keep the TestRunDetailsPageURL from the provisioning response so any abort can be investigated immediately","Prefer aborting runs from the UI (which records messages) over raw API calls that record none","Escalate repeat message-less aborts to support with the run ID - they indicate backend-side causes"],"tags":["cloud","provisioning","abort","observability"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}