Archiva

"Repository Purge By Retention Count" option not working

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.0.2
  • Fix Version/s: 1.1
  • Component/s: repository interface
  • Labels:
    None
  • Environment:
    Linux, JBoss, Continuum SNAPHOT (19/06/2008)
  • Number of attachments :
    0

Description

from http://archiva.apache.org/docs/1.0.2/adminguide/repositories.html:
"If the repository purge by retention count field is set to 2, then only the artifacts artifact-x-20070113.034619-3.jar, artifact-x-20070113.034619-3.pom, artifact-x-20070203.028902-4.jar and artifact-x-20070203.028902-4.pom will be retained in the repository. The oldest snapshots will be deleted maintaining only a number of snapshots equivalent to the set retention count."

This is not working here. The value for "Repository Purge By Retention Count" is ignored, at least for the Snapshot-managed-repo.
Old artifacts are not deleted.
We are building new snaphot's on hourly basis using Continuum.
The disk-space is heavily increasing and nothing is purged.

Activity

Hide
Marc Lustig added a comment -

btw, the consumer "repository-purge" is enabled, of course.

Show
Marc Lustig added a comment - btw, the consumer "repository-purge" is enabled, of course.
Hide
David Greenberg added a comment -

I also have this issue on Tomcat 6.0.16, Solaris 8, Java 1.6.0_06, Archiva 1.0.2. The following is printed to the logs during a scan (times/directories/counts modified):
INFO org.apache.maven.archiva.repository.scanner.RepositoryScanner:default - Walk Started: [snapshots] /correct/path/to/my/snapshots/directory
INFO org.apache.maven.archiva.repository.scanner.RepositoryScanner:default - Walk Finished: [snapshots] /correct/path/to/my/snapshots/directory
INFO org.codehaus.plexus.taskqueue.execution.TaskExecutor:repository-scanning - Finished repository task:
.\ Scan of snapshots \.__________________________________________
Repository Dir : /correct/path/to/my/snapshots/directory
Repository Name : My Snapshots Repository
Repository Layout : default
Known Consumers : (8 configured)
create-missing-checksums
update-db-artifact
repository-purge
index-content
metadata-updater
auto-rename
validate-checksums
auto-remove
Invalid Consumers : <none>
Duration : 5 Minutes 55 Seconds 555 Milliseconds
When Gathered : 3/14/15 9:26 PM
Total File Count : 1000000
Avg Time Per File : 2 Milliseconds
______________________________________________________________

The following are my settings for this repository (again with some values replaced):
Identifier: asnapshotsrepo
Name My Snapshots Repository
Directory /correct/path/to/my/snapshots/directory
WebDAV URL http://correct/URL/to/my/snapshots/repository
Type Maven 2.x Repository
Releases Included
Snapshots Included
Delete Released Snapshots
Repository Purge By Days Older Than 30
Repository Purge By Retention Count 2
Scanned
Scanning Cron 0 0,30 * * * ?

Nothing fancy going on with my configuration...derby DBs, no customization of the webapp, no errors in the logs.

Any ideas?

Show
David Greenberg added a comment - I also have this issue on Tomcat 6.0.16, Solaris 8, Java 1.6.0_06, Archiva 1.0.2. The following is printed to the logs during a scan (times/directories/counts modified): INFO org.apache.maven.archiva.repository.scanner.RepositoryScanner:default - Walk Started: [snapshots] /correct/path/to/my/snapshots/directory INFO org.apache.maven.archiva.repository.scanner.RepositoryScanner:default - Walk Finished: [snapshots] /correct/path/to/my/snapshots/directory INFO org.codehaus.plexus.taskqueue.execution.TaskExecutor:repository-scanning - Finished repository task: .\ Scan of snapshots \.__________________________________________ Repository Dir : /correct/path/to/my/snapshots/directory Repository Name : My Snapshots Repository Repository Layout : default Known Consumers : (8 configured) create-missing-checksums update-db-artifact repository-purge index-content metadata-updater auto-rename validate-checksums auto-remove Invalid Consumers : <none> Duration : 5 Minutes 55 Seconds 555 Milliseconds When Gathered : 3/14/15 9:26 PM Total File Count : 1000000 Avg Time Per File : 2 Milliseconds ______________________________________________________________ The following are my settings for this repository (again with some values replaced): Identifier: asnapshotsrepo Name My Snapshots Repository Directory /correct/path/to/my/snapshots/directory WebDAV URL http://correct/URL/to/my/snapshots/repository Type Maven 2.x Repository Releases Included Snapshots Included Delete Released Snapshots Repository Purge By Days Older Than 30 Repository Purge By Retention Count 2 Scanned Scanning Cron 0 0,30 * * * ? Nothing fancy going on with my configuration...derby DBs, no customization of the webapp, no errors in the logs. Any ideas?
Hide
Maria Odea Ching added a comment -

This is working for me in trunk..

From the configuration above, I can see that the Repository Purge By Days Older Than is set to '30', therefore that's the criteria being used for the purge & not by retention count. I suspect that the artifacts in your repositories are not older than 30 days therefore nothing gets cleaned up. In order to set Archiva to purge by retention count, you need to de-activate the purge by days old by setting the value to '0'. Could you verify this please? Thanks

Sorry, the rules above weren't specified clearly in the docs.. I'll adjust it in trunk now.

Show
Maria Odea Ching added a comment - This is working for me in trunk.. From the configuration above, I can see that the Repository Purge By Days Older Than is set to '30', therefore that's the criteria being used for the purge & not by retention count. I suspect that the artifacts in your repositories are not older than 30 days therefore nothing gets cleaned up. In order to set Archiva to purge by retention count, you need to de-activate the purge by days old by setting the value to '0'. Could you verify this please? Thanks Sorry, the rules above weren't specified clearly in the docs.. I'll adjust it in trunk now.
Hide
Maria Odea Ching added a comment - - edited

Added additional info about the purge in the docs (trunk -r673289).

Repository Purge section in Understanding Repository Configuration of Apache Archiva now looks like this..

Repository purge is the process of cleaning up the repository of old snapshots....

Please take note that the by number of days old criteria is activated by default (set to 100 days). In order to de-activate it and use the by retention count criteria, you must set the Repository Purge By Days Older field to 0. Another thing to note here is that if the by number of days old criteria is activated, the retention count would still be respected (See the Repository Purge By Days Older section below for more details) but not the other way around.
....

Show
Maria Odea Ching added a comment - - edited Added additional info about the purge in the docs (trunk -r673289). Repository Purge section in Understanding Repository Configuration of Apache Archiva now looks like this.. Repository purge is the process of cleaning up the repository of old snapshots.... Please take note that the by number of days old criteria is activated by default (set to 100 days). In order to de-activate it and use the by retention count criteria, you must set the Repository Purge By Days Older field to 0. Another thing to note here is that if the by number of days old criteria is activated, the retention count would still be respected (See the Repository Purge By Days Older section below for more details) but not the other way around. ....
Hide
Nap Ramirez added a comment -

I've set up a repository, deployed 6 snapshots of the same project, then set the Repository Purge By Days Older field to 0 and enabled the repository-purge. It all works for me, the Repository Purge by Retention Count was set to 2, so snapshots 5 & 6 remained after a scan. Btw, I used r673275.

Show
Nap Ramirez added a comment - I've set up a repository, deployed 6 snapshots of the same project, then set the Repository Purge By Days Older field to 0 and enabled the repository-purge. It all works for me, the Repository Purge by Retention Count was set to 2, so snapshots 5 & 6 remained after a scan. Btw, I used r673275.
Hide
Maria Odea Ching added a comment - - edited

Marc, greenberg.d@gmail.com, did the above config work for you? Can we already close this issue?

Show
Maria Odea Ching added a comment - - edited Marc, greenberg.d@gmail.com, did the above config work for you? Can we already close this issue?
Hide
Marc Lustig added a comment -

I can test this only in two weeks, unfortunately.

Show
Marc Lustig added a comment - I can test this only in two weeks, unfortunately.
Hide
Maria Odea Ching added a comment -

Closing this now for 1.1. Please re-open if the config did not work for you after testing it.. Thanks!

Show
Maria Odea Ching added a comment - Closing this now for 1.1. Please re-open if the config did not work for you after testing it.. Thanks!

People

Vote (2)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: