ScheduledTrigger does not fire on schedule
TOC
Problem Description
After creating a ScheduledTrigger, no PipelineRun (or other resources inside the TriggerTemplate) appears at the expected time.
Root Cause Analysis
Common reasons include:
- The cron expression or optional
timeZoneis invalid, or the next tick has not yet occurred in the expected region. - The referenced
TriggerTemplate(or inline template content) cannot be resolved, often because of a wrong name/namespace or missing permissions. - Rendering succeeds but creating the Tekton resources fails due to RBAC issues or validation errors in the template.
For a field-by-field explanation of the ScheduledTrigger spec, see the ScheduledTrigger API and Important Parameter Explanations.
Problem Investigation
Always start with:
The Events section shows warnings such as UnknownTimeZone, UnparseableSchedule, InvalidSchedule, UnknownTriggerTemplate, or FailedCreate. Use those event types to pick the right fix from the sections below.
Follow these checks to narrow down the issue:
Validate the schedule and time zone
- Inspect the schedule with
kubectl get scheduledtrigger <name> -n <namespace> -o jsonpath='{.spec.schedule}'and confirm it is the intended cron expression (minute hour day-of-month month day-of-week). - If
spec.timeZoneis set, confirm that it is a valid time zone (for exampleAsia/Shanghai). Typos cause the controller to emitUnknownTimeZonewarnings and skip executions. When cron syntax is wrong the controller createsUnparseableScheduleorInvalidScheduleevents; correct the expression and reapply. - Compare
kubectl get scheduledtrigger <name> -n <namespace> -o jsonpath='{.status.lastScheduleTime}'with the current time to verify whether the most recent run is actually overdue. Remember that cron expressions are evaluated in the chosen time zone, not the viewer's local clock.
Confirm the TriggerTemplate reference
- When using
spec.triggerTemplate.ref, ensure the referencedTriggerTemplateexists in the same namespace:kubectl get triggertemplate <ref> -n <namespace>. - For inline templates, run
kubectl describe scheduledtrigger <name>and look for validation errors that mention missing fields insidetriggerTemplate. - Make sure any placeholders like
$(context.datetime)are only used inspec.params. The rendered template must reference them via$(tt.params.<name>); using context placeholders elsewhere causes rendering to fail and surfaces asUnknownTriggerTemplatewarnings.
Check events for apply or permission failures
- Run
kubectl describe scheduledtrigger <name> -n <namespace>and review the Events section. Messages such asFailedCreate,ResourceApplyFailed, or RBACforbiddenerrors indicate the controller tried to fire but was blocked. FailedCreatewarnings typically mean Tekton rejected the rendered resource. Inspect the message, adjust the template, and reapply the ScheduledTrigger.- To isolate template issues, try instantiating a
PipelineRunorTaskRundirectly from theTriggerTemplatecontent. Manually replace every$(tt.params.<name>)placeholder with a concrete value, apply the resource, and confirm whether it creates successfully.
Additional Tips
-
When debugging, temporarily change
spec.scheduleto run every minute (for example*/1 * * * *) to confirm whether executions start after adjustments. -
Keep the
ScheduledTriggerandTriggerTemplatein the same namespace to avoid confusion with cross-namespace references. -
Use the
tekton.alaudadevops.io/scheduled-trigger-namelabel to list all resources created by a ScheduledTrigger. For example:Replace
<scheduled-trigger-name>with the name of your resource to see every PipelineRun or TaskRun emitted by that ScheduledTrigger.