Why did my TeamCity build stop working?

10,435

teamcity.build.branch is a predefined build parameter but it is only defined when a branch specification is configured. Therefore, to fix your problem, make sure that your build step has a VCS root configured and add e.g. +:refs/heads/(master) as your branch specification.

From TeamCity's documentation on Agent Requirements and implicit requirements:

Any reference (name in %-signs) to an unknown parameter is considered an "implicit requirement". That means that the build will only run on the agent which provides the parameters named.

Otherwise, the parameter should be made available for the build configuration by defining it on the build configuration or project levels.

Share:
10,435
Tim Long
Author by

Tim Long

I am a freelance software developer and IT professional. I trade as Tigra Astronomy and Tigra Networks. As a software developer I currently specialize in producing firmware and Windows software to control astronomical instruments and devices and I have worked with a number of well-known brands that sell equipment to amateur astronomers. Some of the brands I have worked with to produce shipping commercial products include NexDome, Optec, Gemini Telescope Design, AWR Technology, Technical Innovations. I have also produced one-off solutions for several private individuals and institutions. I am a member of the steering group for The ASCOM Initiative which produces standards and interoperability software used by almost all software available to amateur astronomers, and lately some universities and government departments. This work is purely voluntary but highly rewarding, because the impact of ASCOM on amateur astronomy cannot be overestimated. ASCOM was historically Windows-only but is currently undergoing a transformation to a network-centric cross-platform technology. With my IT hat on, I support several organizations with servers, cloud services and CCTV security systems. I am active mainly with arts companies such as Music Theatre Wales and conservation charities such as Thanet Countryside Trust and Pwll Du Cave Management Group, where I am a trustee. I was awarded Microsoft MVP ('Most Valuable Professional') for Windows Small Business Server in 2007, 2008 and 2009. I prefer to develop in C# and try to be an early adopter of the latest tools and techniques, where it makes sense. CodeMentor Twitter @Tim_Long Google+ Facebook LinkedIn timlong

Updated on June 02, 2022

Comments

  • Tim Long
    Tim Long almost 2 years

    I have a TeamCity build configuration that has been working fine until recently. Suddenly, there is a build stuck in the queue that says it is not compatible with any agents. The reason given is:

    Implicit requirements: teamcity.build.branch defined in Parameter: BuildFormatSpecification

    My BuildFormatSpecification parameter is defined thus:

    %MajorVersion%.%MinorVersion%.%PatchVersion%-%teamcity.build.branch%

    That in turn is used in the Build Number Format field along with a build counter, like this:

    %BuildFormatSpecification%.%sharedBuildNumber.id4%

    The idea is that the build number comes out like "1.0.0-develop.22" and includes the Git branch being built. This follows the rules for Semantic Versioning. This scheme has worked for me over a number of projects, but suddenly this one build is stuck and I can't figure out why.

    Any ideas?

  • Traderhut Games
    Traderhut Games almost 5 years
    Also, Team City doesn't clear the problem once you fix it, you have to delete the build request and re-add it back. Nice. At least, on the version I'm using, which is a few builds back. Ironically, if you set a default branch (required), and then leave the branch specification blank (shouldn't be required, as their description of it is: "Branches to monitor besides the default one " - which is 'none' just monitor the default one. Also, if you switch from a single line here, to two full specifications, your branch displayed changes from 'develop' to /ref/head/develop' which
  • Traderhut Games
    Traderhut Games almost 5 years
    wastes space on the description,and adds junk to the build name - and was causing my builds to fail due to the name... No clue how to fix that..
  • Johan Boberg
    Johan Boberg almost 5 years
    You should ask a new question about branch names but the answer is to use parentheses around the part you want to be displayed, in my example it will be "master". See jetbrains.com/help/teamcity/….