{"record":{"id":"b88a520654041f34","repo":"go-delve/delve","slug":"no-breakpoint-with-id-d-b88a52","errorCode":null,"errorMessage":"no breakpoint with id %d","messagePattern":"no breakpoint with id (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/rpc2/server.go","lineNumber":187,"sourceCode":"\tName string\n}\n\ntype GetBreakpointOut struct {\n\tBreakpoint api.Breakpoint\n}\n\n// GetBreakpoint gets a breakpoint by Name (if Name is not an empty string) or by ID.\nfunc (s *RPCServer) GetBreakpoint(arg GetBreakpointIn, out *GetBreakpointOut) error {\n\tvar bp *api.Breakpoint\n\tif arg.Name != \"\" {\n\t\tbp = s.debugger.FindBreakpointByName(arg.Name)\n\t\tif bp == nil {\n\t\t\treturn fmt.Errorf(\"no breakpoint with name %s\", arg.Name)\n\t\t}\n\t} else {\n\t\tbp = s.debugger.FindBreakpoint(arg.Id)\n\t\tif bp == nil {\n\t\t\treturn fmt.Errorf(\"no breakpoint with id %d\", arg.Id)\n\t\t}\n\t}\n\tout.Breakpoint = *bp\n\treturn nil\n}\n\ntype StacktraceIn struct {\n\tId     int64\n\tDepth  int\n\tFull   bool\n\tDefers bool // read deferred functions (equivalent to passing StacktraceReadDefers in Opts)\n\tOpts   api.StacktraceOptions\n\tCfg    *api.LoadConfig\n\tSkip   int // number of frames to skip\n}\n\ntype StacktraceOut struct {\n\tLocations []api.Stackframe","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/rpc2/server.go#L169-L205","documentation":"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.","triggerScenarios":"GetBreakpoint RPC called with GetBreakpointIn{Id: n} where n was never created or was already cleared.","commonSituations":"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.","solutions":["Call ListBreakpoints to get valid current ids before GetBreakpoint","Re-create the breakpoint with CreateBreakpoint if it was cleared","Refresh cached ids after every Restart or new session","Handle this error as not-found in the client rather than retrying"],"exampleFix":"// before\nbp, err := client.GetBreakpoint(&api.GetBreakpointIn{Id: 7}) // stale id\n// after\nbps, _ := client.ListBreakpoints(false)\nif len(bps) > 0 {\n    bp, err = client.GetBreakpoint(&api.GetBreakpointIn{Id: bps[0].Id})\n}","handlingStrategy":"try-catch","validationCode":"bps, _ := client.ListBreakpoints(false)\nhasID := func(id int) bool {\n    for _, b := range bps { if b.Id == id { return true } }\n    return false\n}","typeGuard":null,"tryCatchPattern":"_, err := client.GetBreakpoint(&api.GetBreakpointIn{Id: id})\nif err != nil && strings.Contains(err.Error(), \"no breakpoint with id\") {\n    // refresh id via ListBreakpoints or re-create the breakpoint\n}","preventionTips":["Never cache breakpoint ids across Restart or new sessions","Resolve ids from ListBreakpoints at point of use","Delete breakpoints by the object returned from creation","Handle not-found distinctly from RPC transport errors"],"tags":["rpc2","breakpoint","not-found"],"backgroundTag":"breakpoint-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}