multica-ai/multica · error

poll_interval must be a Go duration (e.g. 10s, 500ms): %w

Error message

poll_interval must be a Go duration (e.g. 10s, 500ms): %w

What it means

applyConfigSet parses the poll_interval value with time.ParseDuration, which requires Go duration syntax: a number with a unit suffix (s, ms, m, h). Bare numbers ('10'), wrong units ('10 seconds'), and unrecognized suffixes all fail here. The value is validated at set-time so a bad duration is never persisted.

Source

Thrown at server/cmd/multica/cmd_config.go:196

			cfg.MaxConcurrentTasks = 0
			return nil
		}
		n, err := strconv.Atoi(value)
		if err != nil {
			return fmt.Errorf("max_concurrent_tasks must be an integer: %w", err)
		}
		if n < 0 {
			return fmt.Errorf("max_concurrent_tasks must be >= 0 (got %d)", n)
		}
		cfg.MaxConcurrentTasks = n
	case "poll_interval":
		if value == "" {
			cfg.PollInterval = ""
			return nil
		}
		d, err := time.ParseDuration(value)
		if err != nil {
			return fmt.Errorf("poll_interval must be a Go duration (e.g. 10s, 500ms): %w", err)
		}
		// Reject zero and negative durations. Persisting "0s" would look
		// configured in `config show` but be silently ignored at daemon
		// start (the resolver only substitutes strictly positive values),
		// which is exactly the trap reported in #3824's review. Empty
		// string is the one and only way to clear a previously persisted
		// value.
		if d <= 0 {
			return fmt.Errorf("poll_interval must be positive (got %s); use `config set poll_interval \"\"` to clear it", d)
		}
		cfg.PollInterval = value
	case "heartbeat_interval":
		if err := assignPositiveDuration(&cfg.HeartbeatInterval, key, value); err != nil {
			return err
		}
	case "agent_timeout":
		// agent_timeout is the one duration knob where "0s" is a
		// meaningful persisted value (it explicitly disables the

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Add a unit suffix: `multica config set poll_interval 10s` (or 500ms, 1m).
  2. Check for hidden characters/commas if a seemingly valid value still fails.
  3. To clear the persisted value, pass an empty string: `multica config set poll_interval ""`.

Example fix

# before
multica config set poll_interval 30
# after
multica config set poll_interval 30s
Defensive patterns

Strategy: validation

Validate before calling

# validate Go duration syntax before config set
[[ "$VAL" =~ ^[0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h)+$ ]] || { echo "bad duration: $VAL" >&2; exit 2; }
multica config set poll_interval "$VAL"

Prevention

When it happens

Trigger: `multica config set poll_interval 10` (no unit), `... 10sec`, `... 500`, or `... 1m30` (missing unit on the seconds part).

Common situations: Users used to seconds-by-default configs (e.g. YAML 'interval: 30'); copying '500ms' style from docs but editing to '500'; European decimal commas ('0,5s').

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/ccef5055aa3ac98b. Report an issue: GitHub.