Free disk space requirement step runs after updating sources

Completed

We have free disk space build feature configured for our builds. But looking at the build log, it seems like the free disk space requirement runs after "Updating sources" (getting the source files from TFS) and since there is not sufficient disk space, it fails saying "Failed to perform checkout on agent: Failed to perform TFS clean checkout: There is not enough space on the disk."

Is there a way to make the free disk space requirement run even before the sources are downloaded from TFS? 

TeamCity version: TeamCity Enterprise 2019.1.4 (build 66526)

 

5 comments
Comment actions Permalink

I believe the Free Disk Space does run before the sources are updated as well as several other times throughout the build setup, but I would be happy to look into this. Would you mind sending me your build log and teamcity-agent.log from the same build?

0
Comment actions Permalink

Hi Eric, Thanks for your reply. Unfortunately, I cannot share the build log and agent logs due to security policy. I will try to create a test build with the same behavior and get back to you.

0
Comment actions Permalink

Thank you! You can use the Submit a Request button on the top of the page and I will be able to retrieve it from there.

0
Comment actions Permalink

Hi Eric, actually you were right. I could see from the agent log that the free disk space runs even before the sources are updated  and this information is not there in the build log.  

I was able to fix the issue with the build. Actually we have configured system.teamcity.agent.ensure.free.space = 30gb globally for the build agent (in agent's buildAgent.properties file). But for this particular build, we had to override the value and had created a free disk space build feature with value 40gb. But this didn't work as expected as the build was still trying to cleanup only 30gb free space and hence the build failed. Now if I remove the free disk space build feature and add the parameter system.teamcity.agent.ensure.free.space = 40gb to the build, it works as expected.

But still I have not understood why the free disk space check is done at various stages of the build. For instance, in our case, the build needs 40gb which mostly includes only the sources downloaded from TFS. But when we setup a free disk space build feature, the free space check is performed even after the sources are got from TFS which I think is not required as we have already downloaded the sources and wouldn't have enough free space on the agent. 

 

 

 

0
Comment actions Permalink

Hi, I'm glad to hear you were able to find the information in the agent log helpful. Since it is technically running before the build configuration has started, it doesn't show up in the build log. 

The system.teamcity.agent.ensure.free.space in the buildAgent.properties file cannot be overridden by a build parameter at this time. We do, however, have a similar feature request on our YouTrack site. We use our public YouTrack site to determine which features and issues will be addressed in future releases, so I invite you to vote for this feature if you'd like to see it implemented. I've also added a reference to this forum post internally. https://youtrack.jetbrains.com/issue/TW-49759

As far as the reasoning goes for having it run at various stages, it just came down to simplicity when the feature was first implemented. There are times when it is worth running it during a build, but it certainly doesn't apply to every build; as you've identified in your case. It is worth noting that the only time Free Disk Space is actually taking a measurement is at the pre-build stage, where you found it in the agent log. It re-uses this number for subsequent checks. If you're interested in more refined controls for the Free Disk Space build feature, we also have a YouTrack ticket for that. https://youtrack.jetbrains.com/issue/TW-50139

I hope you find this helpful. If you have more questions, feel free to ask. 

0

Please sign in to leave a comment.