{"record":{"id":"1225d715f8af1b86","repo":"go-delve/delve","slug":"unknown-access-type-q","errorCode":null,"errorMessage":"unknown access type: %q","messagePattern":"unknown access type: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/dap/server.go","lineNumber":2006,"sourceCode":"\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{\n\t\t\twatchpoint: true,\n\t\t\tgoid:       goid,\n\t\t\tframe:      int(frame),\n\t\t\texpr:       v[2],\n\t\t\twtype:      wtype,\n\t\t}, nil\n\t})\n\n\tresponse := &dap.SetDataBreakpointsResponse{Response: *s.newResponse(request.Request)}\n\tresponse.Body.Breakpoints = breakpoints\n\ts.send(response)\n}\n\nfunc (s *Session) clearBreakpoints(existingBps map[string]*api.Breakpoint, amendedBps map[string]struct{}) error {\n\tfor req, bp := range existingBps {\n\t\tif _, ok := amendedBps[req]; ok {","sourceCodeStart":1988,"sourceCodeEnd":2024,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/dap/server.go#L1988-L2024","documentation":"The accessType field of a DAP data breakpoint must be one of 'read', 'write', or 'readWrite'. Any other string is rejected because Delve cannot map it to a hardware watchpoint WatchType.","triggerScenarios":"setDataBreakpoints with Arguments.Breakpoints[i].AccessType outside the three supported values (empty, uppercase, 'rw', etc.).","commonSituations":"Clients defaulting accessType to '' or sending a non-DAP-spec value; older clients using different watchpoint vocabularies.","solutions":["Send one of exactly 'read', 'write', or 'readWrite' (case-sensitive)","If unsure, use 'write' which is the most commonly supported watchpoint type","Omit the field only if the client previously obtained the dataId, then match the DAP spec's default ('write')"],"exampleFix":"// before\n{\"accessType\":\"RW\"}\n// after\n{\"accessType\":\"readWrite\"}","handlingStrategy":"validation","validationCode":"var accessTypes = map[string]bool{\"read\":true,\"write\":true,\"readWrite\":true}\nfunc validAccessType(a string) bool { return accessTypes[a] }","typeGuard":"func normalizeAccessType(a string) (string, bool) {\n  switch a { case \"read\",\"write\",\"readWrite\": return a, true; default: return \"\", false }\n}","tryCatchPattern":"if err := setDataBreakpoints(req); err != nil { if strings.Contains(err.Error(), \"unknown access type\") { /* set accessType='write' and retry */ } }","preventionTips":["Use exactly 'read','write','readWrite' (lowercase, case-sensitive)","Default to 'write' when the client cannot determine access type","Validate against the DAP spec enum before sending"],"tags":["dap","watchpoints","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}