{"record":{"id":"31e50b5b39cb7088","repo":"multica-ai/multica","slug":"timezone-is-only-valid-with-kind-schedule","errorCode":null,"errorMessage":"--timezone is only valid with --kind schedule","messagePattern":"--timezone is only valid with --kind schedule","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_autopilot.go","lineNumber":557,"sourceCode":"\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tkind, _ := cmd.Flags().GetString(\"kind\")\n\tif kind == \"\" {\n\t\tkind = \"schedule\"\n\t}\n\tif kind != \"schedule\" && kind != \"webhook\" {\n\t\treturn fmt.Errorf(\"--kind must be schedule or webhook\")\n\t}\n\tcron, _ := cmd.Flags().GetString(\"cron\")\n\tif kind == \"schedule\" && cron == \"\" {\n\t\treturn fmt.Errorf(\"--cron is required for --kind schedule\")\n\t}\n\tif kind == \"webhook\" {\n\t\tif v, _ := cmd.Flags().GetString(\"timezone\"); v != \"\" {\n\t\t\treturn fmt.Errorf(\"--timezone is only valid with --kind schedule\")\n\t\t}\n\t\tif cron != \"\" {\n\t\t\treturn fmt.Errorf(\"--cron is only valid with --kind schedule\")\n\t\t}\n\t}\n\n\tbody := map[string]any{\"kind\": kind}\n\tif kind == \"schedule\" {\n\t\tbody[\"cron_expression\"] = cron\n\t\tif v, _ := cmd.Flags().GetString(\"timezone\"); v != \"\" {\n\t\t\tbody[\"timezone\"] = v\n\t\t}\n\t}\n\tif v, _ := cmd.Flags().GetString(\"label\"); v != \"\" {\n\t\tbody[\"label\"] = v\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_autopilot.go#L539-L575","documentation":"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.","triggerScenarios":"Running `autopilot trigger add <ref> --kind webhook --timezone UTC` (or any timezone value). No network request is issued.","commonSituations":"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.","solutions":["Remove --timezone from the webhook trigger command","If you actually need a timezone, switch to --kind schedule with --cron and --timezone"],"exampleFix":"// before\nmultica autopilot trigger add my-pilot --kind webhook --timezone UTC\n// --timezone is only valid with --kind schedule\n\n// after\nmultica autopilot trigger add my-pilot --kind webhook","handlingStrategy":"validation","validationCode":"if [ \"$KIND\" = \"webhook\" ] && [ -n \"$TZ\" ]; then echo \"--timezone is only valid with --kind schedule\" >&2; exit 2; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build flag sets per kind in wrapper scripts instead of sharing one flag list","When converting schedule commands to webhook, strip --timezone and --cron"],"tags":["go","cli","flag-validation","webhook","triggers"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}