{"record":{"id":"9a9d403d9d23d721","repo":"vitessio/vitess","slug":"invalid-throttlerlogz-path","errorCode":null,"errorMessage":"invalid /throttlerlogz path","messagePattern":"invalid /throttlerlogz path","errorType":"http","errorClass":null,"httpStatus":404,"severity":"info","filePath":"go/vt/throttler/throttlerlogz.go","lineNumber":115,"sourceCode":"`\n\nvar (\n\tlogEntryTemplate  = template.Must(template.New(\"logEntry\").Parse(logEntryHTML))\n\tlogFooterTemplate = template.Must(template.New(\"logFooter\").Parse(logFooterHTML))\n)\n\nfunc init() {\n\tservenv.HTTPHandleFunc(\"/throttlerlogz/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tthrottlerlogzHandler(w, r, GlobalManager)\n\t})\n}\n\nfunc throttlerlogzHandler(w http.ResponseWriter, r *http.Request, m *managerImpl) {\n\t// Longest supported URL: /throttlerlogz/<name>\n\tparts := strings.SplitN(r.URL.Path, \"/\", 3)\n\n\tif len(parts) != 3 {\n\t\thttp.Error(w, \"invalid /throttlerlogz path\", http.StatusNotFound)\n\t\treturn\n\t}\n\n\tname := parts[2]\n\tif name == \"\" {\n\t\t// If no name is given, redirect to the list of throttlers at /throttlerz.\n\t\thttp.Redirect(w, r, \"/throttlerz\", http.StatusTemporaryRedirect)\n\t\treturn\n\t}\n\n\tif !slices.Contains(m.Throttlers(), name) {\n\t\thttp.Error(w, \"throttler not found\", http.StatusNotFound)\n\t\treturn\n\t}\n\n\tshowThrottlerLog(w, m, name)\n}\n","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/throttler/throttlerlogz.go#L97-L133","documentation":"throttlerlogzHandler parses the URL path with strings.SplitN(path, \"/\", 3) and requires exactly 3 segments (/throttlerlogz/<name>). If the path has fewer segments (e.g. no trailing slash), it returns 404 'invalid /throttlerlogz path'. The longest supported URL is /throttlerlogz/<name>.","triggerScenarios":"Requesting /throttlerlogz (no trailing slash, produces only 2 parts after split) or any path with fewer than 3 '/'-separated segments, on a vitess process exposing the throttler debug endpoints.","commonSituations":"Typing /throttlerlogz in a browser without trailing slash and name; old bookmarks; scripts missing the trailing slash before the throttler name.","solutions":["Request /throttlerlogz/ with a trailing slash to get the throttler list redirect.","Request /throttlerlogz/<throttler-name> for a specific throttler's log.","Get the exact throttler name from /throttlerz and append it to the path.","If serving behind a proxy, ensure it does not strip the trailing slash."],"exampleFix":"// before\ncurl http://localhost:15000/throttlerlogz\n// after\ncurl http://localhost:15000/throttlerlogz/","handlingStrategy":"validation","validationCode":"p := r.URL.Path\nif !strings.HasPrefix(p, \"/throttlerlogz/\") {\n\treturn fmt.Errorf(\"use /throttlerlogz/ or /throttlerlogz/<name>\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the trailing slash when no throttler name is given (/throttlerlogz/).","Build URLs with path.Join(\"/throttlerlogz\", name) instead of string concatenation.","Check reverse-proxy configs for trailing-slash normalization."],"tags":["http","routing","url","throttler"],"backgroundTag":"invalid-url-path","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}