{"record":{"id":"e7129858455eca22","repo":"SigNoz/signoz","slug":"errcodepricingruleinvalidinput","errorCode":"ErrCodePricingRuleInvalidInput","errorMessage":"id is not a valid uuid","messagePattern":"id is not a valid uuid","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/modules/llmpricingrule/implllmpricingrule/handler.go","lineNumber":175,"sourceCode":"func ruleIDFromPath(r *http.Request) (valuer.UUID, error) {\n\traw := mux.Vars(r)[\"id\"]\n\tid, err := valuer.NewUUID(raw)\n\tif err != nil {\n\t\treturn valuer.UUID{}, errors.Wrapf(err, errors.TypeInvalidInput, llmpricingruletypes.ErrCodePricingRuleInvalidInput, \"id is not a valid uuid\")\n\t}\n\treturn id, nil\n}","sourceCodeStart":null,"sourceCodeEnd":null,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/modules/llmpricingrule/implllmpricingrule/handler.go#L175","documentation":"The LLM pricing rule handler failed to parse the {id} path variable as a UUID. ruleIDFromPath (pkg/modules/llmpricingrule/impllmpricingrule/handler.go:171-178) takes the mux route variable and calls valuer.NewUUID; if parsing fails the error is wrapped with ErrCodePricingRuleInvalidInput and returned as an invalid-input HTTP error. It means the client called a pricing-rule endpoint (GET/PUT/DELETE) with a malformed rule id.","triggerScenarios":"Any request to /api/v1/rules/{id} style LLM pricing rule routes where {id} is not a canonical UUID, e.g. 'rules/latest', 'rules/123', a truncated UUID, or a UUID with surrounding whitespace/percent-encoding issues.","commonSituations":"Hand-crafted curl calls, frontend passing an internal numeric id or a placeholder string instead of the UUID returned by the create endpoint, copy-paste truncation of the UUID, or stale client code using old id formats.","solutions":["Verify the id value in the request URL is the exact UUID returned when the pricing rule was created","Check for truncation/whitespace/percent-encoding in the path segment and re-send with the raw UUID","If the frontend builds the URL from state, confirm that field actually stores the rule UUID and is populated","Inspect server access logs for the full URL to spot the malformed segment"],"exampleFix":"// before\ncurl -X DELETE https://signoz/api/v1/rules/rule-42\n\n// after\ncurl -X DELETE https://signoz/api/v1/rules/5f0c1b2e-3a44-4c9d-9e1f-7b8d6a2c0e55","handlingStrategy":"validation","validationCode":"const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nif (!UUID_RE.test(ruleId)) throw new Error(`invalid rule id: ${ruleId}`);\nawait api.deleteRule(ruleId);","typeGuard":"function isUUID(v: string): boolean {\n  return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(v);\n}","tryCatchPattern":"try { await api.getRule(id); } catch (e) { if (e.code === 'pricing_rule_invalid_input') showUserError('Rule not found: bad id'); else throw e; }","preventionTips":["Always source rule ids from the create/list API responses, never construct them","Validate UUID format client-side before building the URL","URL-encode path segments to avoid encoding corruption"],"tags":["uuid","path-parameter","invalid-input","rest-api","golang"],"backgroundTag":"invalid-uuid-path-parameter","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}