ScheduledTrigger does not fire on schedule
TOC
Problem DescriptionRoot Cause AnalysisProblem InvestigationValidate the schedule and time zoneConfirm the TriggerTemplate referenceCheck events for apply or permission failuresAdditional TipsProblem 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 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). An unknown time zone or an invalid cron expression is rejected when theScheduledTriggeris created or updated, so the create or apply command reports the error; correct the value 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. If every run creation has failed so far,lastScheduleTimestays empty and the command prints nothing; use the events fromkubectl describeabove instead. - If a run is due, but
lastScheduleTimehas not changed andkubectl describeshows no new event, check that the ScheduledTrigger controller is running. This needs read access to Pods intekton-pipelines, usually a cluster administrator:kubectl get pods -n tekton-pipelines -l app=tektoncd-enhancement-controllermust list a Pod inRunningstate.tekton-pipelinesis the default ofTektonConfigspec.targetNamespace; replace it in the command if your installation uses another namespace.
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, the admission webhook checks the template when the
ScheduledTriggeris created or updated and rejects an invalid one, so the create or apply command reports the error, for exampleadmission webhook "vscheduledtrigger-v1alpha1.kb.io" denied the request: missing field(s): spec.resourcetemplates. Correct the template and reapply. - Use context placeholders such as
$(context.datetime)only inspec.params, and reference them in the TriggerTemplate through$(tt.params.<name>). A context placeholder written directly in the TriggerTemplate is not replaced: the run is still created on schedule, no warning event is recorded, and the field keeps the literal text$(context.datetime). In ascriptstep, the shell then treats that text as a command substitution, so the value is empty. If a run shows a literal$(context.<name>)value, move the placeholder intospec.params.
Check events for apply or permission failures
- Run
kubectl describe scheduledtrigger <name> -n <namespace>and review the Events section. Messages such asFailedCreateor 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 the
PipelineRun,TaskRunorCustomRundirectly 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. -
spec.triggerTemplate.refnames aTriggerTemplatein the namespace of theScheduledTrigger; aTriggerTemplatein another namespace cannot be referenced. When a run is due and the template is not found there, the controller records the warning eventUnknownTriggerTemplateand creates no run. -
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 list the PipelineRuns or TaskRuns of that ScheduledTrigger that still exist. Runs that the Pruner or a user deleted are not listed, so an empty list alone does not show that the ScheduledTrigger did not fire. For a template that emits aCustomRun, runkubectl get customrunwith the same label. For a template that emits aPipelineRun, thetaskrunandcustomrunqueries also list the runs of thatPipelineRun, because Tekton copies thePipelineRunlabels to them. To list only the runs that the ScheduledTrigger created itself, exclude them with!tekton.dev/pipelineRun: