{"record":{"id":"c0c29f448033ba0e","repo":"ipfs/kubo","slug":"unknown-collector-s","errorCode":null,"errorMessage":"unknown collector '%s'","messagePattern":"unknown collector '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"profile/profile.go","lineNumber":145,"sourceCode":"\tarchive *zip.Writer\n\topts    Options\n}\n\nfunc (p *profiler) runProfile(ctx context.Context) error {\n\ttype profileResult struct {\n\t\tfName string\n\t\tbuf   *bytes.Buffer\n\t\terr   error\n\t}\n\n\tctx, cancelFn := context.WithCancel(ctx)\n\tdefer cancelFn()\n\n\tcollectorsToRun := make([]collector, len(p.opts.Collectors))\n\tfor i, name := range p.opts.Collectors {\n\t\tc, ok := collectors[name]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unknown collector '%s'\", name)\n\t\t}\n\t\tcollectorsToRun[i] = c\n\t}\n\n\tresults := make(chan profileResult, len(p.opts.Collectors))\n\twg := sync.WaitGroup{}\n\tfor _, c := range collectorsToRun {\n\t\tif !c.enabledFunc(p.opts) {\n\t\t\tcontinue\n\t\t}\n\n\t\tfName := c.outputFileName()\n\n\t\twg.Add(1)\n\t\tgo func(c collector) {\n\t\t\tdefer wg.Done()\n\t\t\tlogger.Infow(\"collecting profile\", \"File\", fName)\n\t\t\tdefer logger.Infow(\"profile done\", \"File\", fName)","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/profile/profile.go#L127-L163","documentation":"runProfile validates that every collector name in p.opts.Collectors exists in the collectors registry; an unknown name returns \"unknown collector '<name>'\" before any collection runs. This is a configuration/typo error, not a runtime fault.","triggerScenarios":"Calling WriteProfiles with opts.Collectors containing a name not registered in the collectors map (typo, renamed collector, or collector removed in a newer/older version).","commonSituations":"Debug profiling requests with hand-written collector names, API clients built against a different kubo version where the collector list changed, or programmatic profile config assembled from stale docs.","solutions":["Correct the collector name to one of the registered names in profile/profile.go's collectors map","List valid names from the collectors map (or the command's help output) before configuring","If a collector was removed in an upgrade, migrate the profile config to its replacement","Validate names at config-load time so bad profiles fail early with a clear message"],"exampleFix":"// before\np, _ := profile.Setup(\"cpu,netwrok,locks\") // typo\n// after\np, _ := profile.Setup(\"cpu,network,locks\")","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"cpu\": true, \"heap\": true, \"goroutines\": true /* see collectors map */}\nfor _, name := range collectors {\n    if !valid[name] { return fmt.Errorf(\"unknown collector %q\", name) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy collector names exactly from profile/profile.go or command help","Validate profile strings at config load time","After kubo upgrades, re-check that configured collectors still exist"],"tags":["profiling","config","validation"],"backgroundTag":"unknown-option","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}