{"record":{"id":"5293bb5e078905cb","repo":"vitessio/vitess","slug":"no-app-indicated","errorCode":null,"errorMessage":"no app indicated","messagePattern":"no app indicated","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vttablet/tabletserver/throttle/check.go","lineNumber":101,"sourceCode":"// NewThrottlerCheck creates a ThrottlerCheck\nfunc NewThrottlerCheck(throttler *Throttler) *ThrottlerCheck {\n\treturn &ThrottlerCheck{\n\t\tthrottler: throttler,\n\t}\n}\n\n// checkAppMetricResult allows an app to check on a metric\nfunc (check *ThrottlerCheck) checkAppMetricResult(ctx context.Context, appName string, metricResultFunc base.MetricResultFunc, flags *CheckFlags) (checkResult *CheckResult) {\n\t// Handle deprioritized app logic\n\tdenyApp := false\n\t//\n\tmetricResult, threshold, matchedApp := check.throttler.AppRequestMetricResult(ctx, appName, metricResultFunc, denyApp)\n\tif flags.OverrideThreshold > 0 {\n\t\tthreshold = flags.OverrideThreshold\n\t}\n\tvalue, err := metricResult.Get()\n\tif appName == \"\" {\n\t\treturn NewCheckResult(tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED, value, threshold, \"\", errors.New(\"no app indicated\"))\n\t}\n\n\tvar responseCode tabletmanagerdatapb.CheckThrottlerResponseCode\n\tswitch {\n\tcase err == base.ErrAppDenied:\n\t\t// app specifically not allowed to get metrics\n\t\tresponseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED\n\tcase err == base.ErrNoSuchMetric:\n\t\t// not collected yet, or metric does not exist\n\t\tresponseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_UNKNOWN_METRIC\n\tcase err != nil:\n\t\t// any error\n\t\tresponseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_INTERNAL_ERROR\n\tcase value > threshold:\n\t\t// casual throttling\n\t\tresponseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED\n\t\terr = base.ErrThresholdExceeded\n\tdefault:","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vttablet/tabletserver/throttle/check.go#L83-L119","documentation":"This error comes from CheckApp in the throttler package when Check is invoked without a valid app name. The throttler evaluates metrics per application, so an empty appName cannot be matched against configured app rules (throttler's app-configured metric thresholds). Rather than silently treating it as the default app, the throttler returns CheckThrottlerResponseCode_APP_DENIED with this error.","triggerScenarios":"Calling Check (via checkAppMetricResult/Check) with flags or request context whose appName resolves to \"\" — e.g. a throttler check RPC that omits the app name, or a caller constructing CheckRequest without setting AppName.","commonSituations":"Custom scripts hitting the throttler HTTP/gRPC endpoint directly without the app parameter; older clients calling throttler APIs before app-name fields were mandatory; copy-pasted throttler check code dropping the app name.","solutions":["Set the app name in the throttler check request (CheckRequest.app_name) before calling Check.","If writing Go code, ensure the app name is a non-empty string passed to Check; default to a known app like \"vreplication\" or \"onlineddl\" only when intentional.","Check the client/tool version: upgrade callers that predate mandatory app names in throttler requests."],"exampleFix":"// before\nresp := throttlerApp.Check(ctx, tabletmanagerdatapb.ThrottlerAction_CheckTablet, nil) // app name empty\n// after\nresp := throttlerApp.Check(ctx, tabletmanagerdatapb.ThrottlerAction_CheckTablet, &throttle.BaseFlags{AppName: \"my-app\"})","handlingStrategy":"validation","validationCode":"if appName == \"\" { return fmt.Errorf(\"app name must be set before calling throttler Check\") }","typeGuard":"func hasAppName(app string) bool { return strings.TrimSpace(app) != \"\" }","tryCatchPattern":null,"preventionTips":["Always populate CheckRequest.AppName / BaseFlags.AppName for throttler calls.","Centralize throttler client calls in a helper that validates the app name first.","Add a unit test asserting non-empty app names on all throttler call sites."],"tags":["vitess","throttler","validation","vttablet"],"backgroundTag":"missing-required-argument","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}