wavetermdev/waveterm · error

must provide a builderId to DeleteBuilderCommand

Error message

must provide a builderId to DeleteBuilderCommand

What it means

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.

Source

Thrown at pkg/wshrpc/wshserver/wshserver.go:1131

}

func (ws *WshServer) RenameAppFileCommand(ctx context.Context, data wshrpc.CommandRenameAppFileData) error {
	if data.AppId == "" {
		return fmt.Errorf("must provide an appId to RenameAppFileCommand")
	}
	return waveappstore.RenameAppFile(data.AppId, data.FromFileName, data.ToFileName)
}

func (ws *WshServer) WriteAppSecretBindingsCommand(ctx context.Context, data wshrpc.CommandWriteAppSecretBindingsData) error {
	if data.AppId == "" {
		return fmt.Errorf("must provide an appId to WriteAppSecretBindingsCommand")
	}
	return waveappstore.WriteAppSecretBindings(data.AppId, data.Bindings)
}

func (ws *WshServer) DeleteBuilderCommand(ctx context.Context, builderId string) error {
	if builderId == "" {
		return fmt.Errorf("must provide a builderId to DeleteBuilderCommand")
	}
	buildercontroller.DeleteController(builderId)
	return nil
}

func (ws *WshServer) StartBuilderCommand(ctx context.Context, data wshrpc.CommandStartBuilderData) error {
	if data.BuilderId == "" {
		return fmt.Errorf("must provide a builderId to StartBuilderCommand")
	}
	bc := buildercontroller.GetOrCreateController(data.BuilderId)
	rtInfo := wstore.GetRTInfo(waveobj.MakeORef("builder", data.BuilderId))
	if rtInfo == nil {
		return fmt.Errorf("builder rtinfo not found for builderid: %s", data.BuilderId)
	}
	appId := rtInfo.BuilderAppId
	if appId == "" {
		return fmt.Errorf("builder appid not set for builderid: %s", data.BuilderId)
	}

View on GitHub (pinned to a4447c1563)

Solutions

  1. Pass the actual builder id string to DeleteBuilderCommand
  2. Verify the builder record in wstore actually has a non-empty id
  3. Guard the caller with an empty check before issuing the RPC

Example fix

// before
err := client.DeleteBuilderCommand(ctx, builderId) // builderId == ""
// after
if builderId != "" {
    err := client.DeleteBuilderCommand(ctx, builderId)
}
Defensive patterns

Strategy: validation

Validate before calling

if builderId == "" {
    return fmt.Errorf("cannot delete builder: builderId is empty")
}
err := client.DeleteBuilderCommand(ctx, builderId)

Type guard

func isNonEmpty(s string) bool { return s != "" }

Try / catch

if err := client.DeleteBuilderCommand(ctx, builderId); err != nil {
    if strings.Contains(err.Error(), "must provide a builderId") {
        // caller bug: skip or surface, don't retry
    }
    return err
}

Prevention

When it happens

Trigger: Calling DeleteBuilderCommand RPC with builderId == "" — e.g. the caller passed an unset variable, or the builder id was never resolved from UI state.

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/4d62f333b5717f11. Report an issue: GitHub.