{"record":{"id":"3db6b9e78252cbbf","repo":"grafana/k6","slug":"could-not-load-and-configure-the-test-w","errorCode":null,"errorMessage":"could not load and configure the test: %w","messagePattern":"could not load and configure the test: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/cloud_run.go","lineNumber":159,"sourceCode":"\t\t)\n\t}\n\n\tif c.noCloudLogs {\n\t\treturn errext.WithExitCodeIfNone(\n\t\t\tfmt.Errorf(\"the --no-cloud-logs flag can only be used in conjunction with the --local-execution flag\"),\n\t\t\texitcodes.InvalidConfig,\n\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{","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/grafana/k6/blob/94169daab29df52c1ed2ee0549657a577666b855/internal/cmd/cloud_run.go#L141-L177","documentation":"In cloud run with --local-execution, loadAndConfigureLocalTest failed to load the script/archive and apply cloud-oriented configuration. The wrapped error carries the concrete cause: unreadable or missing file, syntax error, invalid options, or bad config merging.","triggerScenarios":"Thrown at internal/cmd/cloud_run.go:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the root cause","Verify the script path is correct and the script runs locally with k6 run","Fix syntax errors and invalid options in the script"],"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"}