wavetermdev/waveterm · error
generating badge id: %v
Error message
generating badge id: %v
What it means
When setting (not clearing) a badge, badgeRun generates a unique badge id with uuid.NewV7(). If UUID generation fails (e.g. insufficient system entropy), the error is wrapped as "generating badge id: %v".
Source
Thrown at cmd/wsh/cmd/wshcmd-badge.go:77
return fmt.Errorf("resolving block: %v", err)
}
if oref.OType != waveobj.OType_Block && oref.OType != waveobj.OType_Tab {
return fmt.Errorf("badge oref must be a block or tab (got %q)", oref.OType)
}
var eventData baseds.BadgeEvent
eventData.ORef = oref.String()
if badgeClear {
eventData.Clear = true
} else {
icon := "circle-small"
if len(args) > 0 {
icon = args[0]
}
badgeId, err := uuid.NewV7()
if err != nil {
return fmt.Errorf("generating badge id: %v", err)
}
eventData.Badge = &baseds.Badge{
BadgeId: badgeId.String(),
Icon: icon,
Color: badgeColor,
Priority: badgePriority,
PidLinked: badgePid > 0,
}
}
event := wps.WaveEvent{
Event: wps.Event_Badge,
Scopes: []string{oref.String()},
Data: eventData,
}
err = wshclient.EventPublishCommand(RpcClient, event, &wshrpc.RpcOpts{NoResponse: true})
if err != nil {View on GitHub (pinned to a4447c1563)
Solutions
- Check the host's entropy source is available (e.g. /dev/urandom readable inside containers).
- Re-run the command — entropy failures are often transient.
- Fix container security settings (seccomp/device restrictions) that block random device access.
Defensive patterns
Strategy: retry
Try / catch
badgeId, err := uuid.NewV7()
if err != nil {
// retry once; if persistent, check host entropy (/dev/urandom)
} Prevention
- Ensure containers can read /dev/urandom.
- Retry transient entropy failures.
- Keep the Go crypto runtime up to date.
When it happens
Trigger: uuid.NewV7() returns an error — typically crypto/rand unavailable or the underlying entropy source failing on the host.
Common situations: Running in a heavily restricted container/OS sandbox where /dev/urandom or the crypto entropy pool is unavailable; corrupted Go crypto runtime — rare in practice.
Related errors
- failed to generate UUID: %w
- no files or message provided
- too many files (maximum %d files allowed)
- stdin (-) can only be used once
- reading from stdin: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/3ab88b4fff9cabf8.
Report an issue: GitHub.