{"record":{"id":"240e32b47bd1e4f0","repo":"vitessio/vitess","slug":"api-registered-but-not-handled-please-open-an-iss","errorCode":null,"errorMessage":"API registered but not handled. Please open an issue at https://github.com/vitessio/vitess/issues/new/choose","messagePattern":"API registered but not handled\\. Please open an issue at https://github\\.com/vitessio/vitess/issues/new/choose","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"go/vt/vtorc/server/api.go","lineNumber":103,"sourceCode":"\t\tenableGlobalRecoveriesAPIHandler(response)\n\tcase healthAPI:\n\t\thealthAPIHandler(response, request)\n\tcase problemsAPI:\n\t\tproblemsAPIHandler(response, request)\n\tcase errantGTIDsAPI:\n\t\terrantGTIDsAPIHandler(response, request)\n\tcase detectionAnalysisAPI:\n\t\tdetectionAnalysisAPIHandler(response, request)\n\tcase databaseStateAPI:\n\t\tdatabaseStateAPIHandler(response)\n\tcase configAPI:\n\t\tconfigAPIHandler(response)\n\tcase shardQuorumAPI:\n\t\tshardQuorumAPIHandler(response)\n\tdefault:\n\t\t// This should be unreachable. Any endpoint which isn't registered is automatically redirected to /debug/status.\n\t\t// This code will only be reachable if we register an API but don't handle it here. That will be a bug.\n\t\thttp.Error(response, \"API registered but not handled. Please open an issue at https://github.com/vitessio/vitess/issues/new/choose\", http.StatusInternalServerError)\n\t}\n}\n\n// getACLPermissionLevelForAPI returns the acl permission level that is required to run a given API\nfunc getACLPermissionLevelForAPI(apiEndpoint string) string {\n\tswitch apiEndpoint {\n\tcase problemsAPI, errantGTIDsAPI:\n\t\treturn acl.MONITORING\n\tcase disableGlobalRecoveriesAPI, enableGlobalRecoveriesAPI:\n\t\treturn acl.ADMIN\n\tcase detectionAnalysisAPI, configAPI:\n\t\treturn acl.MONITORING\n\tcase healthAPI, databaseStateAPI:\n\t\treturn acl.MONITORING\n\tcase shardQuorumAPI:\n\t\treturn acl.MONITORING\n\t}\n\treturn acl.ADMIN","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtorc/server/api.go#L85-L121","documentation":"The vtorc debug API router dispatches registered endpoints in a switch; the default branch handles endpoints that are registered but have no handler case. The code comments say this is unreachable in correct code — reaching it means an API path was registered in getACLPermissionLevelForAPI/routing but the ServeHTTP switch was not updated. It is an internal invariant violation surfaced as a 500.","triggerScenarios":"Requesting a vtorc /debug/ API endpoint whose constant was added to registration (e.g. in the endpoint list or ACL mapping) but whose case was omitted from the switch in ServeHTTP. Typically happens after a partial contribution of a new API endpoint.","commonSituations":"Running a dev build or patched vitess where a new vtorc API endpoint was half-added; or a version mismatch where routing tables and handlers disagree.","solutions":["Check vtorc/server/api.go ServeHTTP switch and add a case for the unhandled endpoint","Verify you are running an unmodified vitess release; if patched, complete the registration","Open an issue at https://github.com/vitessio/vitess/issues/new/choose as the message instructs","As a workaround use a different registered endpoint that exposes equivalent data"],"exampleFix":"// before (in ServeHTTP switch)\ndefault:\n\thttp.Error(response, \"API registered but not handled...\", http.StatusInternalServerError)\n// after\n\tcase myNewAPI:\n\t\tmyNewAPIHandler(response)\ndefault:\n\thttp.Error(response, \"API registered but not handled...\", http.StatusInternalServerError)","handlingStrategy":"validation","validationCode":"// only call endpoints registered in getACLPermissionLevelForAPI / the ServeHTTP switch\nknownEndpoints := map[string]bool{\"problems\": true, \"errant-gtids\": true, \"database-state\": true, \"config\": true}\nif !knownEndpoints[endpoint] {\n\t// skip; endpoint is unregistered or known-broken\n}","typeGuard":null,"tryCatchPattern":"resp, err := http.Get(vtorcURL + path)\nif err == nil && resp.StatusCode == 500 && strings.Contains(body, \"API registered but not handled\") {\n\tlog.Error(\"vtorc API routing bug; report to vitess issues\")\n}","preventionTips":["Run official vitess releases, not partially patched builds","After adding a vtorc API, always add both an ACL entry and a ServeHTTP case","Add a routing test enumerating all registered endpoints","Pin vtorc client tooling to endpoints known to exist in your version"],"tags":["vtorc","http-api","routing","internal-bug"],"backgroundTag":"api-endpoint-not-handled","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}