{"record":{"id":"d198a901254b3762","repo":"grafana/k6","slug":"could-not-serialize-overridden-cloud-configuration","errorCode":null,"errorMessage":"could not serialize overridden cloud configuration: %w","messagePattern":"could not serialize overridden cloud configuration: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/outputs_cloud.go","lineNumber":191,"sourceCode":"\tconf.TestRunDetails = null.StringFrom(result.TestRunDetailsPageURL)\n\n\t// Register secrets config (always present in the provisioning response).\n\tif gs.CloudSecretSource != nil {\n\t\tgs.CloudSecretSource.SetConfig(&cloudsecrets.Config{\n\t\t\tToken:        result.RuntimeConfig.TestRunToken,\n\t\t\tEndpoint:     result.RuntimeConfig.Secrets.Endpoint,\n\t\t\tResponsePath: result.RuntimeConfig.Secrets.ResponsePath,\n\t\t})\n\t}\n\n\t// Configure the log pusher for the self-provisioned run. The run id is\n\t// the provisioning result's TestRunID.\n\tconfigureCloudLogPusher(gs, conf, strconv.FormatInt(result.TestRunID, 10))\n\n\t// Serialise overridden Config back into the collectors map (existing pattern).\n\traw, err := cloudConfToRawMessage(conf)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not serialize overridden cloud configuration: %w\", err)\n\t}\n\tif test.derivedConfig.Collectors == nil {\n\t\ttest.derivedConfig.Collectors = make(map[string]json.RawMessage)\n\t}\n\ttest.derivedConfig.Collectors[builtinOutputCloud.String()] = raw\n\n\treturn nil\n}\n\n// applyExternalProvisioningCreds handles the externally-provisioned\n// `--local-execution` flow, signalled by K6_CLOUD_PUSH_REF_ID: an external\n// service created and started the run and hands its scoped push credentials\n// to this local k6 via env. It reads K6_CLOUD_METRICS_PUSH_URL and\n// K6_CLOUD_TEST_RUN_TOKEN explicitly here — they are deliberately NOT\n// env-bound on cloudapi.Config, so a stray env var can never override the\n// values the self-provision flow obtains from the provisioning response.\n// It requires both-or-neither and, when both are present, sets them on conf\n// (so downstream consumers such as the log pusher see them) and bakes them","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/cmd/outputs_cloud.go#L173-L209","documentation":"Error \"could not serialize overridden cloud configuration: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/cmd/outputs_cloud.go:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}