{"record":{"id":"1c9a20fbde5e5180","repo":"grafana/k6","slug":"marshalling-options-w","errorCode":null,"errorMessage":"marshalling options: %w","messagePattern":"marshalling options: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/outputs_cloud.go","lineNumber":145,"sourceCode":"\t\treturn err\n\t}\n\n\tif conf.ProjectID.Int64 == 0 {\n\t\tprojectID, err := resolveDefaultProjectID(gs, &conf)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif projectID > 0 {\n\t\t\tconf.ProjectID = null.IntFrom(projectID)\n\t\t}\n\t}\n\n\t// Marshal the resolved lib.Options as json.RawMessage for the request\n\t// body's `options` field. No map[string]any round-trip — preserves\n\t// typed precision from lib.Options custom marshalers.\n\toptionsJSON, err := json.Marshal(test.derivedConfig.Options)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshalling options: %w\", err)\n\t}\n\n\tctx := gs.Ctx\n\tresult, err := provClient.ProvisionLocalExecution(ctx, provisioning.ProvisionParams{\n\t\tName:          conf.Name.String,\n\t\tProjectID:     conf.ProjectID.Int64,\n\t\tMaxVUs:        int64(lib.GetMaxPossibleVUs(executionPlan)), //nolint:gosec\n\t\tTotalDuration: int64(duration / time.Second),\n\t\tOptions:       json.RawMessage(optionsJSON),\n\t\tArchive:       testArchive,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Stash testRunID in env (existing pattern).\n\ttest.preInitState.RuntimeOptions.Env[testRunIDKey] = strconv.FormatInt(result.TestRunID, 10)\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/cmd/outputs_cloud.go#L127-L163","documentation":"Error \"marshalling options: %w\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/cmd/outputs_cloud.go:145 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"}