{"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/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cloudapi/provisioning/api.go#L146-L182","documentation":"Returned by Client.WaitForTestRunReady (internal/cloudapi/provisioning/api.go:164) when the test run reached status 'aborted' before 'initializing' but no aborted entry in status_history carried a message, so there is nothing to append. It is the same terminal condition as the %s variant, just with an unhelpfully silent backend history. The run cannot proceed; k6 stops before local execution begins.","triggerScenarios":"Backend flips the run to 'aborted' with empty history messages — automatic aborts (internal scheduler decisions, timeouts in the queue pipeline) often record no human-readable message, unlike user-initiated or policy aborts.","commonSituations":"Backend-side automation aborting stale queued runs; status propagation races where the abort entry is written without a message field; older cloud API versions that did not populate messages.","solutions":["Open the test run page in Grafana Cloud (its URL/ID appears earlier in the k6 output) — the UI timeline usually shows more than the API message field.","Check org quotas/billing anyway; silent aborts are frequently quota/limit automation.","Retry the run once — if it aborts silently again at the same stage, gather the test run ID and report it to k6 Cloud support.","Verify with collaborators that nobody aborted the run from the UI."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := c.WaitForTestRunReady(ctx, testRunID, poll); err != nil {\n\tif err.Error() == \"test run aborted before starting\" {\n\t\t// no backend message — inspect the run in the UI by ID before assuming a bug\n\t\tlog.Warnf(\"run %d aborted with no message; check the project dashboard\", testRunID)\n\t}\n\treturn err\n}","preventionTips":["Keep the test run ID handy (print it) so silent aborts can be traced in the UI timeline.","Check quotas/billing first — silent aborts are most often automated limits.","Retry once; consistent silent aborts warrant a support ticket with the run ID."],"tags":["k6","cloud","provisioning","test-run","aborted"],"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"}