go-delve/delve · error

no breakpoint with id %d

Error message

no breakpoint with id %d

What it means

RPCServer.GetBreakpoint, when arg.Name is empty, looks up by numeric Id via debugger.FindBreakpoint; a nil result yields this error. Signals that no breakpoint with that id exists in the current debug session.

Source

Thrown at service/rpc2/server.go:187

	Name string
}

type GetBreakpointOut struct {
	Breakpoint api.Breakpoint
}

// GetBreakpoint gets a breakpoint by Name (if Name is not an empty string) or by ID.
func (s *RPCServer) GetBreakpoint(arg GetBreakpointIn, out *GetBreakpointOut) error {
	var bp *api.Breakpoint
	if arg.Name != "" {
		bp = s.debugger.FindBreakpointByName(arg.Name)
		if bp == nil {
			return fmt.Errorf("no breakpoint with name %s", arg.Name)
		}
	} else {
		bp = s.debugger.FindBreakpoint(arg.Id)
		if bp == nil {
			return fmt.Errorf("no breakpoint with id %d", arg.Id)
		}
	}
	out.Breakpoint = *bp
	return nil
}

type StacktraceIn struct {
	Id     int64
	Depth  int
	Full   bool
	Defers bool // read deferred functions (equivalent to passing StacktraceReadDefers in Opts)
	Opts   api.StacktraceOptions
	Cfg    *api.LoadConfig
	Skip   int // number of frames to skip
}

type StacktraceOut struct {
	Locations []api.Stackframe

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Call ListBreakpoints to get valid current ids before GetBreakpoint
  2. Re-create the breakpoint with CreateBreakpoint if it was cleared
  3. Refresh cached ids after every Restart or new session
  4. Handle this error as not-found in the client rather than retrying

Example fix

// before
bp, err := client.GetBreakpoint(&api.GetBreakpointIn{Id: 7}) // stale id
// after
bps, _ := client.ListBreakpoints(false)
if len(bps) > 0 {
    bp, err = client.GetBreakpoint(&api.GetBreakpointIn{Id: bps[0].Id})
}
Defensive patterns

Strategy: try-catch

Validate before calling

bps, _ := client.ListBreakpoints(false)
hasID := func(id int) bool {
    for _, b := range bps { if b.Id == id { return true } }
    return false
}

Try / catch

_, err := client.GetBreakpoint(&api.GetBreakpointIn{Id: id})
if err != nil && strings.Contains(err.Error(), "no breakpoint with id") {
    // refresh id via ListBreakpoints or re-create the breakpoint
}

Prevention

When it happens

Trigger: GetBreakpoint RPC called with GetBreakpointIn{Id: n} where n was never created or was already cleared.

Common situations: Client cached a stale breakpoint id from a previous session; breakpoint was removed via ClearBreakpoint; ids restart per debug session so ids from an old session are invalid after Restart.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/b88a520654041f34. Report an issue: GitHub.