Artifacts are not cleaned up (Team City 9.1.6 Enterprise)

Answered

We are using TeamCity Enterprise 9.1.6 (build 37459). I have a minimal build configuration that has a single Power Shell build step that creates a new file:

  New-Item new_file.txt -type file

I have also configured the below artifact paths:

  new_file.txt => test.zip

Under the Clean-up rules I have set the following rule for artifacts for a build configuration:

  Artifacts older than the 1st successful build; artifact patterns: +:**/*

Meaning that only one artifact should be kept. I have now run the build several times but it keeps artifacts for all builds:

 

Why are the artifacts not cleaned up? I took a look at the data directory:

 


And they are all there. What am I missing?

 

Notice:

  1. The builds are NOT pinned
  2. The build is NOT used as a source for artifact dependency in other builds
  3. The build is NOT used as a snapshot dependency in other builds
  4. No builds were manually deleted within the last day.

I also looked at:

https://teamcity-support.jetbrains.com/hc/en-us/community/posts/206829295-clean-up-not-removing-artifacts?input_string=Artifacts%20are%20not%20cleaned%20up%20(Team%20City%20enterprise)

and:

https://teamcity-support.jetbrains.com/hc/en-us/community/posts/206169269-Old-artifacts-are-not-deleted?input_string=Artifacts%20are%20not%20cleane

But did not find an answer.

/Johannes

 

3 comments

Hi Johannes,

By default clean-up process runs once a day. You can check it on Administartion >  Clean-up Settings page.

Did the clean-up run after the last builds and after you set up rules? If not, please run it manually and check if the builds are deleted.

0

Thanks for the quick response.

Yes I did try to run that manually but for one of our project it has no effect. I have created that project from scratch again and triggering the clean up manually now seems to work for that project too.

It could be great if the clean-up would be triggered when the limit was reached for each build config though - we will have lots of pushes going in during a single workday with potentially lots of artifacts.

0

Currently it's only possible configure (via UI) clean-up to trigger once a day. Please vote for the request: https://youtrack.jetbrains.com/issue/TW-5050.
As workaround you can trigger clean-up via emulating the clean-up start action sent from browser, see the comment with example request.

0

Please sign in to leave a comment.