{"record":{"id":"6bea079569518461","repo":"go-delve/delve","slug":"malformed-data-id-q","errorCode":null,"errorMessage":"malformed data ID: %q","messagePattern":"malformed data ID: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/dap/server.go","lineNumber":1990,"sourceCode":"\t})\n}\n\nconst dataBpPrefix = \"dataBreakpoint\"\n\nfunc (s *Session) onSetDataBreakpointRequest(request *dap.SetDataBreakpointsRequest) {\n\tbreakpoints := s.setBreakpoints(s.getWatchpoints(), len(request.Arguments.Breakpoints), func(i int) *bpMetadata {\n\t\twant := request.Arguments.Breakpoints[i]\n\t\treturn &bpMetadata{\n\t\t\tname:         fmt.Sprintf(\"%s %s\", dataBpPrefix, want.DataId),\n\t\t\tcondition:    want.Condition,\n\t\t\thitCondition: want.HitCondition,\n\t\t\tlogMessage:   \"\",\n\t\t}\n\t}, func(i int) (*bpLocation, error) {\n\t\twant := request.Arguments.Breakpoints[i]\n\t\tv := strings.SplitN(want.DataId, \",\", 3)\n\t\tif len(v) != 3 {\n\t\t\treturn nil, fmt.Errorf(\"malformed data ID: %q\", want.DataId)\n\t\t}\n\t\tgoid, err1 := strconv.ParseInt(v[0], 0, 64)\n\t\tframe, err2 := strconv.ParseInt(v[1], 0, 64)\n\t\tif err1 != nil || err2 != nil {\n\t\t\treturn nil, fmt.Errorf(\"malformed data ID: %q\", want.DataId)\n\t\t}\n\t\tvar wtype api.WatchType\n\t\tswitch want.AccessType {\n\t\tcase \"read\":\n\t\t\twtype = api.WatchRead\n\t\tcase \"write\":\n\t\t\twtype = api.WatchWrite\n\t\tcase \"readWrite\":\n\t\t\twtype = api.WatchRead | api.WatchWrite\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown access type: %q\", want.AccessType)\n\t\t}\n\t\treturn &bpLocation{","sourceCodeStart":1972,"sourceCodeEnd":2008,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/dap/server.go#L1972-L2008","documentation":"A DAP data breakpoint's DataId must be the string '<goid>,<frame>,<expression>' (three comma-separated parts). The submitted DataId did not have exactly three comma-separated components, so Delve cannot decode it.","triggerScenarios":"setDataBreakpoints request whose Arguments.Breakpoints[i].DataId is not produced by a previous scopes/variables call (i.e. not of the form 'goid,frame,expr').","commonSituations":"A client fabricating data breakpoint IDs instead of echoing back the dataId provided in Variable responses, or IDs from an older session/target after restart.","solutions":["Use the dataId string exactly as returned in Variable results from a previous variables request","Re-fetch scopes/variables after a restart and re-create data breakpoints from fresh IDs","Ensure no commas inside the expression part break the 3-part format"],"exampleFix":"// before\n{\"breakpoints\":[{\"dataId\":\"42\"}]}\n// after: goid,frame,expr as returned by DAP variables\n{\"breakpoints\":[{\"dataId\":\"1,0,myVar\",\"accessType\":\"write\"}]}","handlingStrategy":"type-guard","validationCode":"func validDataId(id string) bool { parts := strings.Split(id, \",\"); return len(parts) == 3 }","typeGuard":"func isWellFormDataId(id string) bool {\n  v := strings.Split(id, \",\")\n  if len(v) != 3 { return false }\n  _, e1 := strconv.ParseInt(v[0], 0, 64)\n  _, e2 := strconv.ParseInt(v[1], 0, 64)\n  return e1 == nil && e2 == nil\n}","tryCatchPattern":"if err := setDataBreakpoints(req); err != nil { if strings.Contains(err.Error(), \"malformed data ID\") { req.Breakpoints = refreshDataIdsFromVariables(); retry } }","preventionTips":["Always echo dataId strings verbatim from Variable responses","Refresh data breakpoints from a new variables request after restarts","Never construct dataIds by hand"],"tags":["dap","watchpoints","validation"],"backgroundTag":"malformed-data-breakpoint-id","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}