{"record":{"id":"b49537fd54904855","repo":"grafana/k6","slug":"could-not-create-the-cloud-test-run-w","errorCode":null,"errorMessage":"could not create the cloud test run: %w","messagePattern":"could not create the cloud test run: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/cloud_run.go","lineNumber":166,"sourceCode":"\t\t)\n\t}\n\n\treturn applyCloudEnvOverrides(c.gs, cmd, &c.showCloudLogs, &c.exitOnRunning)\n}\n\nfunc (c *cmdCloudRun) run(cmd *cobra.Command, args []string) error {\n\tif c.localExecution {\n\t\tc.runCmd.loadConfiguredTest = func(*cobra.Command, []string) (*loadedAndConfiguredTest, execution.Controller, error) {\n\t\t\ttest, err := loadAndConfigureLocalTest(c.runCmd.gs, cmd, args, getCloudRunLocalExecutionConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, fmt.Errorf(\"could not load and configure the test: %w\", err)\n\t\t\t}\n\n\t\t\tif err := createCloudTest(c.runCmd.gs, test); err != nil {\n\t\t\t\tif errors.Is(err, errCloudAuth) {\n\t\t\t\t\treturn nil, nil, err\n\t\t\t\t}\n\t\t\t\treturn nil, nil, fmt.Errorf(\"could not create the cloud test run: %w\", err)\n\t\t\t}\n\n\t\t\treturn test, local.NewController(), nil\n\t\t}\n\t\treturn c.runCmd.run(cmd, args)\n\t}\n\n\t// When running the `k6 cloud run` command explicitly disable the usage report.\n\tc.noUsageReport = true\n\n\treturn runCloudTest(c.gs, cmd, args, cloudTestRunOptions{\n\t\tshowCloudLogs: c.showCloudLogs,\n\t\texitOnRunning: c.exitOnRunning,\n\t})\n}\n\nfunc (c *cmdCloudRun) flagSet() *pflag.FlagSet {\n\tflags := pflag.NewFlagSet(\"\", pflag.ContinueOnError)","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/grafana/k6/blob/94169daab29df52c1ed2ee0549657a577666b855/internal/cmd/cloud_run.go#L148-L184","documentation":"In cloud run with --local-execution, createCloudTest failed to register the test run with the Grafana Cloud k6 API. The wrapped error is typically an auth failure (bad token), an unreachable cloud host, or a rejected test definition.","triggerScenarios":"Thrown at internal/cmd/cloud_run.go:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify K6_CLOUD_TOKEN / the cloud API token is valid and has the right permissions","Check K6_CLOUD_HOST connectivity and any proxy settings","Inspect the wrapped error for the API's rejection reason"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94169daab29df52c1ed2ee0549657a577666b855","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}