{"record":{"id":"da0ceacee85e704b","repo":"grafana/k6","slug":"98","errorCode":"98","errorMessage":"Test progress error","messagePattern":"Test progress error","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/cloud.go","lineNumber":382,"sourceCode":"\n\t\ttestProgressLock.Lock()\n\t\ttestProgress = newTestProgress\n\t\ttestProgressLock.Unlock()\n\n\t\tif newTestProgress.IsFinished() ||\n\t\t\t(c.exitOnRunning && newTestProgress.IsRunning()) {\n\t\t\tglobalCancel()\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Stop progress rendering before printing final status to avoid ghost bars.\n\tprogressCancel()\n\tprogressBarWG.Wait()\n\n\tif testProgress == nil {\n\t\t//nolint:staticcheck\n\t\treturn errext.WithExitCodeIfNone(errors.New(\"Test progress error\"), exitcodes.CloudFailedToGetProgress)\n\t}\n\n\tc.printTestStatus(testProgress.FormatStatus())\n\n\tif testProgress.ThresholdsFailed() {\n\t\t//nolint:staticcheck\n\t\treturn errext.WithExitCodeIfNone(errors.New(\"Thresholds have been crossed\"), exitcodes.ThresholdsHaveFailed)\n\t}\n\tif testProgress.TestFailed() {\n\t\t//nolint:staticcheck\n\t\treturn errext.WithExitCodeIfNone(errors.New(\"The test has failed\"), exitcodes.CloudTestRunFailed)\n\t}\n\n\treturn nil\n}\n\nfunc (c *cmdCloud) printTestStatus(status string) {\n\tif !c.gs.Flags.Quiet {","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/cmd/cloud.go#L364-L400","documentation":"During `k6 cloud run`, k6 polls the cloud API for test progress every 2 seconds and logs per-poll failures as 'Test progress error' while continuing. If the wait loop ends with testProgress still nil — i.e. not a single poll ever succeeded — this error is returned with exit code 98 (CloudFailedToGetProgress), telling you k6 never learned the test's state.","triggerScenarios":"Every FetchTest(testRunID) poll fails for the entire watch window: invalid/expired token mid-run, network or proxy outage between you and the cloud API, the test run ID being aborted or removed server-side, or the run being interrupted before the first successful poll at t=2s.","commonSituations":"VPN/proxy dropping long-lived connections; token revoked while the test ran; test aborted from the Grafana Cloud UI immediately after start; flaky networking in CI containers. The per-poll cause is visible in the 'Test progress error' log lines printed above the final error.","solutions":["Read the 'Test progress error' log lines just above the final message — they contain the actual per-poll cause","Re-authenticate with `k6 cloud login` if the logged cause is 401/403","Check network/proxy stability for long-running requests if the cause is a transport error","Open the test run in the Grafana Cloud UI to confirm it still exists and inspect its outcome"],"exampleFix":"# before\nk6 cloud run script.js   # ends with: Test progress error (exit code 98)\n\n# after: capture per-poll causes and verify auth/network first\nK6_LOG_LEVEL=debug k6 cloud run script.js 2>&1 | tee cloud-run.log\n# then fix whatever the repeated \"Test progress error\" lines report (401 -> re-login; timeout -> proxy/network)","handlingStrategy":"validation","validationCode":"# preflight before a cloud run: auth valid and API reachable\nk6 cloud login --show || exit 1\ncurl -fsS -o /dev/null \"https://$K6_CLOUD_STACK.grafana.net\" || { echo \"stack unreachable\"; exit 1; }","typeGuard":null,"tryCatchPattern":"err := cmd.Execute() // k6 cloud run\nif ee, ok := err.(*exec.ExitError); ok && ee.ExitCode() == exitcodes.CloudFailedToGetProgress {\n    // every progress poll failed: inspect the 'Test progress error' log lines,\n    // re-authenticate or fix networking, then re-run the test\n}","preventionTips":["Check the 'Test progress error' log lines above the failure — they carry the real per-poll cause","Validate the token with `k6 cloud login` before long cloud runs","Ensure CI networks allow long-lived HTTPS to the stack host, including proxies"],"tags":["cloud","cli","progress","exit-code","network"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}