we have set up a Teamcity environment running builds in different projects. As there are projects that referencing other projects we set up snapshot dependencies to build up the build chains. We also have multiple build agents so all dependencies are configured to run on the same build agent as the main build was triggered. Its usually running fine when the builds are triggered by the system (via code checkin). But if we start a build manually, the build chain stops somehow after building some of the dependencies. The queue shows me that there are no compatible agents. If I force the rebuild of all dependencies on a manual Build request then everything runs fine.

All depending projects in the chain can be build on both agents. And the whole chain is building fine when I force the dependencies to rebuild. But I don't like to rebuild a dependency when there is no need to do this. It's just not working when I hit the "Run"-Button.

I found out that build 3895 was built on BuildAgent2 but the build chain was triggered on BuildAgent1. So there must be a problem by checking dependencies regarding the build history. The agent, where the previous build was running on is not considered for the decision if it needs to be rebuilt or not. And then the dependency is missing on the selected build agent and the whole chain stops working.