wavetermdev/waveterm · error
badgeid is required
Error message
badgeid is required
What it means
Returned when the request requires a badgeid but none was supplied.
Source
Thrown at pkg/wshrpc/wshremote/wshremote.go:149
if impl.IsLocal {
return filepath.Join(wavebase.GetWaveDataDir(), "bin", "wsh"), nil
}
wshPath, err := wavebase.ExpandHomeDir("~/.waveterm/bin/wsh")
if err != nil {
return "", fmt.Errorf("cannot expand wsh path: %w", err)
}
return wshPath, nil
}
func (impl *ServerImpl) BadgeWatchPidCommand(ctx context.Context, data wshrpc.CommandBadgeWatchPidData) error {
if data.Pid <= 0 {
return fmt.Errorf("invalid pid: %d", data.Pid)
}
if data.ORef.IsEmpty() {
return fmt.Errorf("oref is required")
}
if data.BadgeId == "" {
return fmt.Errorf("badgeid is required")
}
go func() {
defer func() {
panichandler.PanicHandler("BadgeWatchPidCommand", recover())
}()
for {
time.Sleep(time.Second)
if unixutil.IsPidRunning(data.Pid) {
continue
}
orefStr := data.ORef.String()
event := wps.WaveEvent{
Event: wps.Event_Badge,
Scopes: []string{orefStr},
Data: baseds.BadgeEvent{
ORef: orefStr,
ClearById: data.BadgeId,
},View on GitHub (pinned to a4447c1563)
Solutions
- Set a unique BadgeId when building the command data
- Validate BadgeId != "" in the caller before the RPC
- Check client/server schema versions match
Defensive patterns
Strategy: validation
Validate before calling
if data.BadgeId == "" {
return fmt.Errorf("badgeid must be a non-empty unique identifier")
} Try / catch
if err := BadgeWatchPidCommand(ctx, data); err != nil {
if strings.Contains(err.Error(), "badgeid is required") {
return fmt.Errorf("caller bug: badge watch missing badgeid")
}
return err
} Prevention
- Assign a stable unique BadgeId per badge watch
- Keep client payload schema in sync with server expectations
- Unit-test RPC data construction helpers for required fields
When it happens
Trigger: Calling BadgeWatchPidCommand with CommandBadgeWatchPidData.BadgeId == "".
Common situations: Hand-constructed command data omitting BadgeId; older clients/versions whose payload schema lacked badgeid.
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
- invalid pid: %d
- oref is required
- nil wshrpc passed to wshclient
- no default route
- response channel closed
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/f8d6ef7db8eb9210.
Report an issue: GitHub.