{"record":{"id":"4d62f333b5717f11","repo":"wavetermdev/waveterm","slug":"must-provide-a-builderid-to-deletebuildercommand","errorCode":null,"errorMessage":"must provide a builderId to DeleteBuilderCommand","messagePattern":"must provide a builderId to DeleteBuilderCommand","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshrpc/wshserver/wshserver.go","lineNumber":1131,"sourceCode":"}\n\nfunc (ws *WshServer) RenameAppFileCommand(ctx context.Context, data wshrpc.CommandRenameAppFileData) error {\n\tif data.AppId == \"\" {\n\t\treturn fmt.Errorf(\"must provide an appId to RenameAppFileCommand\")\n\t}\n\treturn waveappstore.RenameAppFile(data.AppId, data.FromFileName, data.ToFileName)\n}\n\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}","sourceCodeStart":1113,"sourceCodeEnd":1149,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshrpc/wshserver/wshserver.go#L1113-L1149","documentation":"DeleteBuilderCommand removes a builder controller by id, and requires a non-empty builderId. The server rejects the call with this error before calling buildercontroller.DeleteController, since deleting with an empty id is meaningless/unsafe.","triggerScenarios":"Calling DeleteBuilderCommand RPC with builderId == \"\" — e.g. the caller passed an unset variable, or the builder id was never resolved from UI state.","commonSituations":"Automation scripts iterating builders where a record has a blank id; frontend delete handlers firing before the builder list has loaded; refactored code that renamed the id field and stopped passing it.","solutions":["Pass the actual builder id string to DeleteBuilderCommand","Verify the builder record in wstore actually has a non-empty id","Guard the caller with an empty check before issuing the RPC"],"exampleFix":"// before\nerr := client.DeleteBuilderCommand(ctx, builderId) // builderId == \"\"\n// after\nif builderId != \"\" {\n    err := client.DeleteBuilderCommand(ctx, builderId)\n}","handlingStrategy":"validation","validationCode":"if builderId == \"\" {\n    return fmt.Errorf(\"cannot delete builder: builderId is empty\")\n}\nerr := client.DeleteBuilderCommand(ctx, builderId)","typeGuard":"func isNonEmpty(s string) bool { return s != \"\" }","tryCatchPattern":"if err := client.DeleteBuilderCommand(ctx, builderId); err != nil {\n    if strings.Contains(err.Error(), \"must provide a builderId\") {\n        // caller bug: skip or surface, don't retry\n    }\n    return err\n}","preventionTips":["Filter out blank ids before batch delete loops","Disable delete actions until a builder is selected","Keep builder id in a single typed field, not scattered string vars"],"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"}