{"record":{"id":"6529bd360fd88084","repo":"kopia/kopia","slug":"error-setting-limits","errorCode":null,"errorMessage":"error setting limits","messagePattern":"error setting limits","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command_repository_throttle_set.go","lineNumber":37,"sourceCode":"\tcmd.Action(svc.directRepositoryWriteAction(c.run))\n}\n\nfunc (c *commandRepositoryThrottleSet) run(ctx context.Context, rep repo.DirectRepositoryWriter) error {\n\tthr := rep.Throttler()\n\tlimits := thr.Limits()\n\n\tvar changeCount int\n\n\tif err := c.cts.apply(ctx, &limits, &changeCount); err != nil {\n\t\treturn err\n\t}\n\n\tif changeCount == 0 {\n\t\tlog(ctx).Info(\"No changes made.\")\n\t\treturn nil\n\t}\n\n\treturn errors.Wrap(rep.Throttler().SetLimits(limits), \"error setting limits\")\n}\n","sourceCodeStart":19,"sourceCodeEnd":39,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/cli/command_repository_throttle_set.go#L19-L39","documentation":"`kopia repository throttle set` computes new throttler limits and applies them with rep.Throttler().SetLimits(limits). This error wraps a failure of that call, meaning the repository refused or failed to persist the new rate limits.","triggerScenarios":"Running `repository throttle set` where SetLimits fails while applying/persisting limits to the open repository — e.g. an error writing the updated throttling parameters into the repository.","commonSituations":"Repository in read-only or degraded state, storage errors when persisting throttler parameters, concurrent modification conflicts, or invalid combination of limit flags that passes CLI parsing but fails at the throttler layer.","solutions":["Re-run the command to rule out a transient storage error.","Verify repository connectivity/health (`kopia repository status`).","Apply limits in a smaller, valid increment and confirm each accepted.","Upgrade kopia if the failure is reproducible with valid inputs (possible persistence bug)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify the repository is healthy and writable before changing throttler settings\nif err := kopia.RepositoryStatus(ctx, cfg); err != nil {\n    return fmt.Errorf(\"repository unhealthy, refusing to set limits: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"err := rep.Throttler().SetLimits(limits)\nif err != nil {\n    // wrapped as \"error setting limits\"; retry transient storage failures\n    if isTransient(err) {\n        time.Sleep(retryDelay)\n        err = rep.Throttler().SetLimits(limits)\n    }\n    if err != nil { return fmt.Errorf(\"error setting limits: %w\", err) }\n}","preventionTips":["Run `kopia repository status` first; don't set limits on a degraded/read-only repository.","Change one throttle parameter at a time to isolate invalid combinations.","Avoid concurrent throttle set operations from multiple clients.","Re-run the command after transient storage errors before deeper debugging."],"tags":["cli","throttling","persistence"],"backgroundTag":"config-write-failed","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}