{"record":{"id":"3a090b50c2a26cc0","repo":"netbirdio/netbird","slug":"value-parameter-is-required","errorCode":null,"errorMessage":"value parameter is required","messagePattern":"value parameter is required","errorType":"http","errorClass":null,"httpStatus":400,"severity":"warning","filePath":"proxy/internal/debug/handler.go","lineNumber":709,"sourceCode":"\n\tif err := client.Stop(ctx); err != nil {\n\t\th.writeJSON(w, map[string]any{\n\t\t\t\"success\": false,\n\t\t\t\"error\":   err.Error(),\n\t\t})\n\t\treturn\n\t}\n\n\th.writeJSON(w, map[string]any{\n\t\t\"success\": true,\n\t\t\"message\": \"client stopped\",\n\t})\n}\n\nfunc (h *Handler) handlePerf(w http.ResponseWriter, r *http.Request) {\n\traw := r.URL.Query().Get(\"value\")\n\tif raw == \"\" {\n\t\thttp.Error(w, \"value parameter is required\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tn, err := strconv.ParseUint(raw, 10, 32)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"invalid value %q: %v\", raw, err), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tcapN := uint32(n)\n\tapplied := 0\n\tfailed := map[string]string{}\n\tfor accountID, client := range h.provider.ListClientsForStartup() {\n\t\tif err := client.SetPerformance(nbembed.Performance{PreallocatedBuffersPerPool: &capN}); err != nil {\n\t\t\tfailed[string(accountID)] = err.Error()\n\t\t\tcontinue\n\t\t}\n\t\tapplied++\n\t}","sourceCodeStart":691,"sourceCodeEnd":727,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/proxy/internal/debug/handler.go#L691-L727","documentation":"The debug performance endpoint GET /debug/perf requires a ?value= query parameter: the number of preallocated buffers per pool pushed to every client via nbembed SetPerformance. An absent or empty value is rejected with 400 before any parsing happens.","triggerScenarios":"GET /debug/perf with no value parameter at all, or value= (empty string), e.g. after a script dropped the query string during URL construction.","commonSituations":"Calling /debug/perf like the parameter-less /debug/runtime endpoint; URL encoding that strips the query string; assuming value is optional with a server-side default.","solutions":["Add the parameter: GET /debug/perf?value=1024","Use a plain base-10 integer that fits in uint32 (0 to 4294967295)","If scripted, build the URL with a query encoder so value is never lost"],"exampleFix":"// before\ncurl http://<proxy-debug>/debug/perf\n\n// after\ncurl 'http://<proxy-debug>/debug/perf?value=1024'","handlingStrategy":"validation","validationCode":"q := url.Values{}\nq.Set(\"value\", strconv.FormatUint(uint64(buffersPerPool), 10))\nreqURL := debugBase + \"/debug/perf?\" + q.Encode() // value can never be missing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build debug URLs with url.Values so parameters are always present and encoded","Keep a named constant for the value parameter in scripts instead of string concatenation"],"tags":["http","proxy","debug-ui","validation","query-param"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}