multica-ai/multica · error

%s must be 'true' or 'false' (got %q)

Error message

%s must be 'true' or 'false' (got %q)

What it means

assignBool, shared by the disable_* toggles (disable_auto_update, disable_auto_reload), parses the value with strconv.ParseBool. It accepts true/false (and 1/0/t/f), but the error message advertises the strict 'true'/'false' contract. Empty string is handled before parsing as 'clear (false)'.

Source

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

		if err := assignBool(&cfg.DisableAutoReload, key, value); err != nil {
			return err
		}
	default:
		return fmt.Errorf("unknown config key %q (supported: %s)", key, joinKeys(configSetSupportedKeys))
	}
	return nil
}

// assignBool parses value as a strict bool into dst. Shared by the
// disable_* toggles. Empty string clears the field (false).
func assignBool(dst *bool, key, value string) error {
	if value == "" {
		*dst = false
		return nil
	}
	b, err := strconv.ParseBool(value)
	if err != nil {
		return fmt.Errorf("%s must be 'true' or 'false' (got %q)", key, value)
	}
	*dst = b
	return nil
}

// assignPositiveDuration parses value as a strictly-positive Go duration
// and writes the raw string into dst. Shared by every persisted daemon
// duration knob except agent_timeout, whose zero value is meaningful.
// Empty string clears the field.
func assignPositiveDuration(dst *string, key, value string) error {
	if value == "" {
		*dst = ""
		return nil
	}
	normalized := strings.TrimSpace(value)
	d, err := time.ParseDuration(normalized)
	if err != nil {
		return fmt.Errorf("%s must be a Go duration (e.g. 10s, 500ms): %w", key, err)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Use literal true or false: `multica config set disable_auto_update true`.
  2. Quote the value and strip spaces in scripts: `-- ... "$(echo "$VAL" | tr -d ' ')"`.
  3. To clear the toggle back to false: pass an empty string.

Example fix

# before
multica config set disable_auto_update yes
# after
multica config set disable_auto_update true
Defensive patterns

Strategy: validation

Validate before calling

# normalize booleans before config set
case "${VAL,,}" in true|1) VAL=true ;; false|0) VAL=false ;; *) echo "bool must be true/false" >&2; exit 2 ;; esac
multica config set disable_auto_update "$VAL"

Prevention

When it happens

Trigger: `multica config set disable_auto_update yes`, `... on`, `... True ` with whitespace, or `... enable`.

Common situations: YAML/JSON muscle memory ('enable: true'); shells passing unquoted values with spaces; Ansible-style 'yes/no' booleans.

Related errors


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