{"record":{"id":"cc72ca2bf6fc92fd","repo":"go-delve/delve","slug":"could-not-find-label-q","errorCode":null,"errorMessage":"could not find label %q","messagePattern":"could not find label %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/dap/config.go","lineNumber":123,"sourceCode":"\targv := config.SplitQuotedFields(rest, '\"')\n\tif len(argv) == 2 && argv[0] == \"-clear\" {\n\t\targv = argv[1:]\n\t\tdelete = true\n\t}\n\tswitch len(argv) {\n\tcase 0:\n\t\t// do nothing, let caller show the current list of labels\n\t\treturn nil\n\tcase 1:\n\t\tif delete {\n\t\t\tfor i := range args.ShowPprofLabels {\n\t\t\t\tif args.ShowPprofLabels[i] == argv[0] {\n\t\t\t\t\tcopy(args.ShowPprofLabels[i:], args.ShowPprofLabels[i+1:])\n\t\t\t\t\targs.ShowPprofLabels = args.ShowPprofLabels[:len(args.ShowPprofLabels)-1]\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"could not find label %q\", argv[0])\n\t\t} else {\n\t\t\targs.ShowPprofLabels = append(args.ShowPprofLabels, argv[0])\n\t\t}\n\tdefault:\n\t\treturn errors.New(\"too many arguments to \\\"config showPprofLabels\\\"\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":105,"sourceCodeEnd":132,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/dap/config.go#L105-L132","documentation":"Removing a pprof label via 'config showPprofLabels -clear <label>' scans the ShowPprofLabels list for an exact match; if the label is not present, 'could not find label %q' is returned. Labels are added with 'config showPprofLabels <label>' and removed only by exact string match.","triggerScenarios":"Evaluating 'config showPprofLabels -clear mylabel' where mylabel was never added, was cleared already, or differs in case/spelling from the stored label.","commonSituations":"Labels added in a previous debug session are gone after restart; typos or case mismatch ('CPU' vs 'cpu'); attempting to clear a label that comes from the runtime rather than the configured list.","solutions":["Run 'config showPprofLabels' with no arguments to see currently configured labels.","Use the exact label string as added, matching case and spacing.","Use 'config showPprofLabels -clear' (no label) to wipe the whole list instead of removing one by one.","Re-add the label if needed after session restart since the list does not persist."],"exampleFix":"// before\nconfig showPprofLabels -clear goroutine_id\n// after\nconfig showPprofLabels -clear goroutineid","handlingStrategy":"validation","validationCode":"out := runEval(\"config showPprofLabels\")\nlabels := parseLabels(out)\nif !labels[label] {\n    return fmt.Errorf(\"label %q not configured\", label)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List labels with the bare command before clearing one","Use 'config showPprofLabels -clear' to reset the whole list","Re-add labels after session restarts since they do not persist"],"tags":["dap","configuration","pprof"],"backgroundTag":"label-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}