Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why did my TeamCity build stop working?

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?

like image 457
Tim Long Avatar asked Mar 11 '14 00:03

Tim Long


People also ask

How do you restart TeamCity?

To restart TeamCity, send stop and then, after it stops, send start . (evaluation only) To start/stop the TeamCity server and one default agent at the same time, use the runAll script, for example: Use runAll. bat start to start the server and default agent.

How do you fail a build on TeamCity?

You can instruct TeamCity to mark a build as failed if some of its metrics (for example, code coverage or artifacts size) have changed compared to another build. For instance, you can mark a build as failed if the code duplicates number is higher than in the previous build.

How do I run a TeamCity build?

To run a custom build with specific changes, open the build results page, go to the Changes tab, expand the required change, click the Run build with this change, and proceed with the options in the Run Custom Build dialog. Use HTTP request or REST API request to TeamCity to trigger a build.


1 Answers

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.

like image 104
Johan Boberg Avatar answered Oct 08 '22 12:10

Johan Boberg