{"record":{"id":"334b4994c6f1c7b0","repo":"vitessio/vitess","slug":"err-error-334b49","errorCode":null,"errorMessage":"err.Error()","messagePattern":"err\\.Error\\(\\)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"go/vt/throttler/throttlerlogz.go","lineNumber":137,"sourceCode":"\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\nfunc showThrottlerLog(w http.ResponseWriter, m *managerImpl, name string) {\n\tresults, err := m.log(name)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tlogz.StartHTMLTable(w)\n\n\tif _, err := io.WriteString(w, logHeaderHTML); err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to execute logHeader template: %v\", err))\n\t}\n\tfor _, r := range results {\n\t\t// Color based on max(tested state, new state).\n\t\tstate := r.TestedState\n\t\tif stateGreater(r.NewState, state) {\n\t\t\tstate = r.NewState\n\t\t}\n\t\tvar colorLevel string\n\t\tswitch state {\n\t\tcase stateIncreaseRate:\n\t\t\tcolorLevel = \"low\"","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/throttler/throttlerlogz.go#L119-L155","documentation":"showThrottlerLog calls m.log(name) to fetch the throttler's log entries; if that returns an error, the handler responds 500 with err.Error() verbatim. This means the manager failed to retrieve the log for a throttler that was just verified to exist.","triggerScenarios":"GET /throttlerlogz/<valid-name> where m.log(name) errors — e.g. internal state race where the throttler was removed between the existence check and the log fetch, or the log lookup key is inconsistent.","commonSituations":"Race with throttler shutdown/unregistration on a busy tablet; querying a tablet while it is shutting down or mid-workflow teardown; internal manager inconsistency.","solutions":["Retry the request — transient races during throttler registration/unregistration usually resolve.","Re-list names via /throttlerz to confirm the throttler still exists, then retry.","Check tablet logs around the failure for the underlying m.log error detail.","If persistent, restart/re-check the tablet or file a bug with the verbatim error text."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt := 0; attempt < 3; attempt++ {\n\tresp, err := http.Get(logzURL)\n\tif err == nil && resp.StatusCode == http.StatusOK {\n\t\t// success\n\t\tresp.Body.Close()\n\t\treturn\n\t}\n\tif resp != nil {\n\t\tresp.Body.Close()\n\t}\n\ttime.Sleep(200 * time.Millisecond << attempt)\n}","preventionTips":["Retry throttler logz fetches with backoff — teardown races are transient.","Confirm via /throttlerz that the throttler still exists after a 500.","Correlate with tablet logs for the underlying m.log error."],"tags":["http","throttler","internal-error","race-condition"],"backgroundTag":"internal-server-error","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}