multica-ai/multica · error

no fields to update; use --enabled, --cron, --timezone, or -

Error message

no fields to update; use --enabled, --cron, --timezone, or --label

What it means

Flag validation in `multica autopilot trigger update` requiring at least one field flag. The command builds a PATCH body only from flags explicitly marked Changed() (--enabled, --cron, --timezone, --label); if none changed, the body map is empty and there is nothing to PATCH, so the CLI fails fast instead of issuing a no-op request.

Source

Thrown at server/cmd/multica/cmd_autopilot.go:686

	body := map[string]any{}
	if cmd.Flags().Changed("enabled") {
		v, _ := cmd.Flags().GetBool("enabled")
		body["enabled"] = v
	}
	if cmd.Flags().Changed("cron") {
		v, _ := cmd.Flags().GetString("cron")
		body["cron_expression"] = v
	}
	if cmd.Flags().Changed("timezone") {
		v, _ := cmd.Flags().GetString("timezone")
		body["timezone"] = v
	}
	if cmd.Flags().Changed("label") {
		v, _ := cmd.Flags().GetString("label")
		body["label"] = v
	}
	if len(body) == 0 {
		return fmt.Errorf("no fields to update; use --enabled, --cron, --timezone, or --label")
	}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	autopilotRef, err := resolveAutopilotID(ctx, client, args[0])
	if err != nil {
		return fmt.Errorf("resolve autopilot: %w", err)
	}
	triggerRef, err := resolveAutopilotTriggerID(ctx, client, autopilotRef.ID, args[1])
	if err != nil {
		return fmt.Errorf("resolve trigger: %w", err)
	}

	var result map[string]any
	path := "/api/autopilots/" + autopilotRef.ID + "/triggers/" + triggerRef.ID
	if err := client.PatchJSON(ctx, path, body, &result); err != nil {
		return fmt.Errorf("update trigger: %w", err)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Include at least one of --enabled, --cron, --timezone, or --label
  2. To flip a trigger on/off: `--enabled true` / `--enabled false`
  3. To change a schedule: combine --cron (and --timezone if needed)

Example fix

// before
multica autopilot trigger update my-pilot tr1
// no fields to update; use --enabled, --cron, --timezone, or --label

// after
multica autopilot trigger update my-pilot tr1 --enabled false
Defensive patterns

Strategy: validation

Validate before calling

[ "$#" -ge 0 ] && { [ -n "$ENABLED" ] || [ -n "$CRON" ] || [ -n "$TZ" ] || [ -n "$LABEL" ]; } || { echo "no fields to update" >&2; exit 2; }

Prevention

When it happens

Trigger: Running `autopilot trigger update <autopilot> <trigger>` with no field flags at all; passing flags that this command does not read (e.g. --kind) which therefore do not count toward the body. Client-side only; no network call.

Common situations: Expecting an interactive edit mode; using --kind which is add-only; environment-variable-driven invocations that omit all field flags by accident.

Related errors


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