cron expression triggering two builds instead of 1

Answered

I want to trigger a build at 10am,11am,1pm,2pm,3pm from Monday-Friday. My cron expression looks like this?:

Date/Time: Cron command: * 0 10,11,13,14,15 * * 2,3,4,5,6 * (Server Time Zone - AEST Australia/Brisbane)

This is triggering two builds with the same message "Triggered 1 minute ago by Schedule Trigger".

The first build is on the hour as expected, but why the second build? Is my cron incorrect?

3 comments
Comment actions Permalink

Hi Dylan,

Your cron settings are correct. Could you please clarify if the build was triggered two times on the same branch with these settings?

I'm asking because if the Trigger only if there are pending changes checkbox is disabled, then the Schedule Trigger can trigger a build for each branch that is configured in the branch filter of the trigger. Is this checkbox enabled in your trigger?

Could you please show me screenshots of the build overview page for both triggered builds in question, a screenshot of the branch filter in your Schedule Trigger, and a screenshot capturing Default branch and Branch specification settings of the VCS root attached to the build?

0
Comment actions Permalink

Hi Mikhail,

  • I don't have the 'Trigger only if there are pending changes' checked.

Here are the screen shots requested:

VCS Root branch specification: Note %build.branch% parameter is set to master on the build.

First triggered build overview

VCS revision details of first build:

Second build overview

Second build VCS revision used

Schedule trigger:

0
Comment actions Permalink

Hi Dylan,

Thanks for the info! Indeed, looks like the build was triggered twice. We will need to check logs to investigate it further, could you please click the "Submit a request" button at the top of the page to create a new support ticket for us. This ticket will be private, nobody except us and you will be able to see it.

Please attach teamcity-server.log that covers the time around when the builds were triggered, teamcity-agent.log from respective agents that cover the same timeframe, and full build logs downloaded from the UI from both builds. Please also provide the same screenshots from this forum thread. Additionally, please let us know the exact TeamCity version you are using. In case you have a multi-node setup, please also mention it and provide the server log from the secondary node as well.

If logs for the builds in this thread have already rotated, please wait until the problem reproduces and then capture all the logs and screenshots.

0

Please sign in to leave a comment.