{"record":{"id":"e0954e3d0262f461","repo":"ipfs/kubo","slug":"parameter-rate-must-be-set","errorCode":null,"errorMessage":"parameter 'rate' must be set","messagePattern":"parameter 'rate' must be set","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"core/corehttp/mutex_profile.go","lineNumber":64,"sourceCode":"// using POST request with parameter 'rate'.\n// The profiler tries to sample 1 event every <rate> nanoseconds.\n// If rate == 1, then the profiler samples every blocking event.\n// To disable, set rate = 0.\nfunc BlockProfileRateOption(path string) ServeOption {\n\treturn func(_ *core.IpfsNode, _ net.Listener, mux *http.ServeMux) (*http.ServeMux, error) {\n\t\tmux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) {\n\t\t\tif r.Method != http.MethodPost {\n\t\t\t\thttp.Error(w, \"only POST allowed\", http.StatusMethodNotAllowed)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif err := r.ParseForm(); err != nil {\n\t\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\trateStr := r.Form.Get(\"rate\")\n\t\t\tif len(rateStr) == 0 {\n\t\t\t\thttp.Error(w, \"parameter 'rate' must be set\", http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\trate, err := strconv.Atoi(rateStr)\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlog.Infof(\"Setting BlockProfileRate to %d\", rate)\n\t\t\truntime.SetBlockProfileRate(rate)\n\t\t})\n\t\treturn mux, nil\n\t}\n}\n","sourceCodeStart":46,"sourceCodeEnd":79,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/corehttp/mutex_profile.go#L46-L79","documentation":"Debug HTTP endpoint exposed by BlockProfileRateOption (default /debug/blockprofilerate): a POST request arrived without the required 'rate' form parameter. The parameter sets the blocking-profile sampling interval in nanoseconds (0 disables).","triggerScenarios":"Thrown at core/corehttp/mutex_profile.go:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the rate parameter in the POST, e.g. curl -X POST -d rate=1000 http://127.0.0.1:5001/debug/blockprofilerate","Use rate=0 to disable the profiler","Use POST, not GET; other methods get 405"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}