kopia/kopia · error

error setting limits

Error message

error setting limits

What it means

`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.

Solutions

  1. Re-run the command to rule out a transient storage error.
  2. Verify repository connectivity/health (`kopia repository status`).
  3. Apply limits in a smaller, valid increment and confirm each accepted.
  4. Upgrade kopia if the failure is reproducible with valid inputs (possible persistence bug).
Defensive patterns

Strategy: retry

Validate before calling

// verify the repository is healthy and writable before changing throttler settings
if err := kopia.RepositoryStatus(ctx, cfg); err != nil {
    return fmt.Errorf("repository unhealthy, refusing to set limits: %w", err)
}

Try / catch

err := rep.Throttler().SetLimits(limits)
if err != nil {
    // wrapped as "error setting limits"; retry transient storage failures
    if isTransient(err) {
        time.Sleep(retryDelay)
        err = rep.Throttler().SetLimits(limits)
    }
    if err != nil { return fmt.Errorf("error setting limits: %w", err) }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of kopia/kopia@82495e54b5 (2026-09-07). Data as JSON: /api/errors/6529bd360fd88084. Report an issue: GitHub.

Appendix: source

Thrown at cli/command_repository_throttle_set.go:37

	cmd.Action(svc.directRepositoryWriteAction(c.run))
}

func (c *commandRepositoryThrottleSet) run(ctx context.Context, rep repo.DirectRepositoryWriter) error {
	thr := rep.Throttler()
	limits := thr.Limits()

	var changeCount int

	if err := c.cts.apply(ctx, &limits, &changeCount); err != nil {
		return err
	}

	if changeCount == 0 {
		log(ctx).Info("No changes made.")
		return nil
	}

	return errors.Wrap(rep.Throttler().SetLimits(limits), "error setting limits")
}

View on GitHub (pinned to 82495e54b5)