multica-ai/multica · error
--timezone is only valid with --kind schedule
Error message
--timezone is only valid with --kind schedule
What it means
Flag validation in `multica autopilot trigger add` rejecting --timezone when the trigger kind is webhook. Timezone only qualifies cron schedules (it is sent as body.timezone for schedule triggers); a webhook fires on incoming HTTP requests and has no notion of a timezone. The check is client-side and runs before the API call.
Source
Thrown at server/cmd/multica/cmd_autopilot.go:557
client, err := newAPIClient(cmd)
if err != nil {
return err
}
kind, _ := cmd.Flags().GetString("kind")
if kind == "" {
kind = "schedule"
}
if kind != "schedule" && kind != "webhook" {
return fmt.Errorf("--kind must be schedule or webhook")
}
cron, _ := cmd.Flags().GetString("cron")
if kind == "schedule" && cron == "" {
return fmt.Errorf("--cron is required for --kind schedule")
}
if kind == "webhook" {
if v, _ := cmd.Flags().GetString("timezone"); v != "" {
return fmt.Errorf("--timezone is only valid with --kind schedule")
}
if cron != "" {
return fmt.Errorf("--cron is only valid with --kind schedule")
}
}
body := map[string]any{"kind": kind}
if kind == "schedule" {
body["cron_expression"] = cron
if v, _ := cmd.Flags().GetString("timezone"); v != "" {
body["timezone"] = v
}
}
if v, _ := cmd.Flags().GetString("label"); v != "" {
body["label"] = v
}
ctx, cancel := cli.APIContext(context.Background())View on GitHub (pinned to 2c0912b6ec)
Solutions
- Remove --timezone from the webhook trigger command
- If you actually need a timezone, switch to --kind schedule with --cron and --timezone
Example fix
// before multica autopilot trigger add my-pilot --kind webhook --timezone UTC // --timezone is only valid with --kind schedule // after multica autopilot trigger add my-pilot --kind webhook
Defensive patterns
Strategy: validation
Validate before calling
if [ "$KIND" = "webhook" ] && [ -n "$TZ" ]; then echo "--timezone is only valid with --kind schedule" >&2; exit 2; fi
Prevention
- Build flag sets per kind in wrapper scripts instead of sharing one flag list
- When converting schedule commands to webhook, strip --timezone and --cron
When it happens
Trigger: Running `autopilot trigger add <ref> --kind webhook --timezone UTC` (or any timezone value). No network request is issued.
Common situations: Copy-pasting a schedule-trigger command and only changing --kind; scripts that set timezone globally via environment/alias flags; assuming the server ignores irrelevant flags.
Related errors
- --cron is only valid with --kind schedule
- --kind must be schedule or webhook
- --cron is required for --kind schedule
- resolve trigger: %w
- rotate webhook url: %w
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/31e50b5b39cb7088.
Report an issue: GitHub.