Schedule trigger with pending changes not running
I have a schedule trigger set to run nightly with a branch filter and TeamCity correctly shows pending changes on each of the build configurations this trigger is used on, but never actually triggers a build.
"Trigger only if there are pending changes" is checked and there are no trigger rules.
I've tried the following branch filters:
- +:dev
- +:refs/heads/dev
- +refs/heads/dev
- +:<default>
None of them make a difference.
This is what I have set up in the "Branch specification" section of the VCS root:
+:refs/heads/(dev)
+:refs/heads/*
The default branch is refs/heads/dev.
The branch filter for the VCS root is +:*.
I have a webhook set up in GitHub to update the repo on commit and it is set on a polling interval of 60 seconds.
The VCS root is inherited from a parent project, and the scheduled trigger is controlled by a template configuration. The template is used by 3 build configurations, all showing pending changes and none actually triggering.
I don't see anything in teamcity-server.log or teamcity-vsc.log that would suggest an error or that TeamCity is attempting to start the build.
I've also set the schedule trigger to run every minute with a cron expression in order to test and that doesn't make a difference either.
Running the build manually works as expected: build runs, picking up the latest changes, resetting the pending status until new commits are pushed.
This has been happening for several versions, but I was running 2020.1.1 (build 78657), and I've upgraded to 2020.1.2 (build 78726) and the problem still persists.
Please sign in to leave a comment.
Hi,
sorry for the delay. I'd like to ask for some clarification first. You mention that "this has been happening for several versions". Do you mean that it has never worked for you, that it worked until a recent version and then it stopped, or that it works for some time and then it stops working at some point?
In general, if even after an upgrade it doesn't work, it's very likely that there is something wrong with the settings. We would like to ask you for specific screenshots of the build trigger settings (the summary page would be ideal, as it includes both the basic and advanced options), then the Version Control Settings of the build configuration, and the VCS Root branch details.
If it works for some time and then it stops working, then it is possible that the thread processing the trigger misbehaves for some reason. A server restart should help here. If it happens regularly, it would make sense to catch a set of thread dumps on the server after an expected trigger should have fired to see if the threads are stuck for some reason.
A possible test would be to remove all settings and remove all the restrictions of the trigger (filters, trigger as well when there are no pending changes, etc) and see if the issue still replicates then. If it works with some degree of settings it would make sense to test multiple scenarios and see which ones trigger the misbehavior.
We use the schedule trigger in a wide variety of environments ourselves and rely on it functioning properly, so there seems to be something specific about your scenario.