{"record":{"id":"c0c2e490abb5224e","repo":"vitessio/vitess","slug":"failed-to-update-throttler-v-err-v","errorCode":null,"errorMessage":"failed to update throttler: %v err: %v","messagePattern":"failed to update throttler: (.+?) err: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/throttler/manager.go","lineNumber":158,"sourceCode":"\treturn configurations, nil\n}\n\n// UpdateConfiguration implements the \"Manager\" interface.\nfunc (m *managerImpl) UpdateConfiguration(throttlerName string, configuration *throttlerdatapb.Configuration, copyZeroValues bool) ([]string, error) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\n\t// Note: The calls to t.UpdateConfiguration() below return no error but the\n\t// called protobuf library functions may panic. This is fine because the\n\t// throttler RPC service has a panic handler which will catch this.\n\n\tif throttlerName != \"\" {\n\t\tt, ok := m.throttlers[throttlerName]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"throttler: %v does not exist\", throttlerName)\n\t\t}\n\t\tif err := t.UpdateConfiguration(configuration, copyZeroValues); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to update throttler: %v err: %v\", throttlerName, err)\n\t\t}\n\t\treturn []string{throttlerName}, nil\n\t}\n\n\tfor name, t := range m.throttlers {\n\t\tif err := t.UpdateConfiguration(configuration, copyZeroValues); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to update throttler: %v err: %v\", name, err)\n\t\t}\n\t}\n\treturn m.throttlerNamesLocked(), nil\n}\n\n// ResetConfiguration implements the \"Manager\" interface.\nfunc (m *managerImpl) ResetConfiguration(throttlerName string) ([]string, error) {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\n\tif throttlerName != \"\" {","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/throttler/manager.go#L140-L176","documentation":"UpdateConfiguration wraps any error returned by the individual throttler's own UpdateConfiguration and re-raises it with the throttler name for context. The throttler rejected the supplied configuration.","triggerScenarios":"Calling Manager.UpdateConfiguration where t.UpdateConfiguration (the per-throttler implementation, e.g. in throttler.go) fails — typically because the Configuration proto contains invalid values (e.g. MaxRate, MaxReplicationLag, IgnoreAppNames constraints) that the throttler validates.","commonSituations":"Sending a ThrottlerUpdateConfiguration RPC with an out-of-range max rate or malformed app-name list; the underlying throttler rejects it and the manager wraps the cause.","solutions":["Read the wrapped err text to see the throttler's validation failure","Correct the Configuration values (valid MaxRate >= 0, valid names) and retry","If resetting, use ResetConfiguration instead of partial invalid updates","Check protobuf field types when constructing throttlerdatapb.Configuration"],"exampleFix":"// before\ncfg.MaxRate = -5 // invalid\nmgr.UpdateConfiguration(ctx, name, cfg, copyZeroValues)\n// after\ncfg.MaxRate = 0 // 0 means disabled\nmgr.UpdateConfiguration(ctx, name, cfg, copyZeroValues)","handlingStrategy":"validation","validationCode":"if cfg.MaxRate < 0 { return errors.New(\"MaxRate must be >= 0\") }\nif cfg.Threshold < 0 { return errors.New(\"Threshold must be >= 0\") }\nfor _, a := range cfg.IgnoreAppNames { if a == \"\" { return errors.New(\"empty app name\") } }","typeGuard":null,"tryCatchPattern":"if _, err := manager.UpdateConfiguration(ctx, name, cfg, copyZeroValues); err != nil {\n    if strings.Contains(err.Error(), \"failed to update throttler\") {\n        return fmt.Errorf(\"invalid throttler config: %w\", err)\n    }\n    return err\n}","preventionTips":["Validate throttlerdatapb.Configuration values before sending","Send 0 to reset fields rather than negative values","Test config changes on one throttler before broadcasting"],"tags":["throttler","configuration","validation"],"backgroundTag":"throttler-config-invalid","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}