{"record":{"id":"d0439e08f73c6bb1","repo":"wavetermdev/waveterm","slug":"must-provide-a-builderid-to-startbuildercommand","errorCode":null,"errorMessage":"must provide a builderId to StartBuilderCommand","messagePattern":"must provide a builderId to StartBuilderCommand","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshrpc/wshserver/wshserver.go","lineNumber":1139,"sourceCode":"\nfunc (ws *WshServer) WriteAppSecretBindingsCommand(ctx context.Context, data wshrpc.CommandWriteAppSecretBindingsData) error {\n\tif data.AppId == \"\" {\n\t\treturn fmt.Errorf(\"must provide an appId to WriteAppSecretBindingsCommand\")\n\t}\n\treturn waveappstore.WriteAppSecretBindings(data.AppId, data.Bindings)\n}\n\nfunc (ws *WshServer) DeleteBuilderCommand(ctx context.Context, builderId string) error {\n\tif builderId == \"\" {\n\t\treturn fmt.Errorf(\"must provide a builderId to DeleteBuilderCommand\")\n\t}\n\tbuildercontroller.DeleteController(builderId)\n\treturn nil\n}\n\nfunc (ws *WshServer) StartBuilderCommand(ctx context.Context, data wshrpc.CommandStartBuilderData) error {\n\tif data.BuilderId == \"\" {\n\t\treturn fmt.Errorf(\"must provide a builderId to StartBuilderCommand\")\n\t}\n\tbc := buildercontroller.GetOrCreateController(data.BuilderId)\n\trtInfo := wstore.GetRTInfo(waveobj.MakeORef(\"builder\", data.BuilderId))\n\tif rtInfo == nil {\n\t\treturn fmt.Errorf(\"builder rtinfo not found for builderid: %s\", data.BuilderId)\n\t}\n\tappId := rtInfo.BuilderAppId\n\tif appId == \"\" {\n\t\treturn fmt.Errorf(\"builder appid not set for builderid: %s\", data.BuilderId)\n\t}\n\treturn bc.Start(ctx, appId, rtInfo.BuilderEnv)\n}\n\nfunc (ws *WshServer) StopBuilderCommand(ctx context.Context, builderId string) error {\n\tif builderId == \"\" {\n\t\treturn fmt.Errorf(\"must provide a builderId to StopBuilderCommand\")\n\t}\n\tbc := buildercontroller.GetController(builderId)","sourceCodeStart":1121,"sourceCodeEnd":1157,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshrpc/wshserver/wshserver.go#L1121-L1157","documentation":"StartBuilderCommand starts a builder's build process via buildercontroller.GetOrCreateController, but first requires data.BuilderId to be non-empty. An empty id would create/lookup a controller keyed by \"\", so the server fails fast with this error.","triggerScenarios":"Invoking the StartBuilderCommand RPC with CommandStartBuilderData.BuilderId == \"\" — the client never set BuilderId, or resolved it from an empty UI/RTInfo field.","commonSituations":"Clicking 'start build' before a builder is selected; scripting the RPC with a partial data struct; state sync lag where the frontend's builder object is still empty.","solutions":["Set BuilderId from the selected builder's OID before calling","Wait for builder state to load in the client before enabling the start action","Validate data non-empty on the client side before the RPC"],"exampleFix":"// before\nclient.StartBuilderCommand(ctx, wshrpc.CommandStartBuilderData{})\n// after\nclient.StartBuilderCommand(ctx, wshrpc.CommandStartBuilderData{BuilderId: builder.OID})","handlingStrategy":"validation","validationCode":"if data.BuilderId == \"\" {\n    return fmt.Errorf(\"cannot start builder: BuilderId is empty\")\n}\nerr := client.StartBuilderCommand(ctx, data)","typeGuard":"func startable(data wshrpc.CommandStartBuilderData) bool {\n    return data.BuilderId != \"\"\n}","tryCatchPattern":"if err := client.StartBuilderCommand(ctx, data); err != nil {\n    if strings.Contains(err.Error(), \"must provide a builderId\") {\n        // set BuilderId from selection and retry once\n    }\n    return err\n}","preventionTips":["Bind the start action to a concrete selected builder object","Validate the full command struct on the client before RPC","Avoid constructing empty data structs for scripting"],"tags":["rpc","validation","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}