Archiva

Repository Purge Consumer throws Invalid Path to Artifact

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.0
  • Fix Version/s: None
  • Component/s: repository scanning
  • Labels:
    None
  • Environment:
    Tomcat 6.0.14
    Windows Server 2003
  • Number of attachments :
    0

Description

I have the repository purge consumer enabled and configured as Repository Purge By Days Older Than to 0 and Repository Purge By Retention Count set to 3.

This is with a clean database.

I have more than 3 versions of org.irene:irene:2.0-SNAPSHOT already uploaded into the repository.

When the repository is scanned:

290870 [pool-2-thread-1] ERROR org.apache.maven.archiva.repository.scanner.RepositoryScanner:default  - Consumer [repository-purge] had an error when processing file [D:\archiva-web\data\repositories\snapshots\org\irene\irene\2.0-SNAPSHOT\irene-2.0-20071214.204316-1-test-sources.jar]: Invalid path to Artifact: filename format is invalid,expected timestamp format in filename.
org.apache.maven.archiva.consumers.ConsumerException: Invalid path to Artifact: filename format is invalid,expected timestamp format in filename.
	at org.apache.maven.archiva.consumers.core.repository.RepositoryPurgeConsumer.processFile(RepositoryPurgeConsumer.java:189)
	at org.apache.maven.archiva.repository.scanner.functors.ConsumerProcessFileClosure.execute(ConsumerProcessFileClosure.java:57)
	at org.apache.commons.collections.functors.IfClosure.execute(IfClosure.java:117)
	at org.apache.commons.collections.CollectionUtils.forAllDo(CollectionUtils.java:388)
	at org.apache.maven.archiva.repository.scanner.RepositoryScannerInstance.directoryWalkStep(RepositoryScannerInstance.java:138)
	at org.codehaus.plexus.util.DirectoryWalker.fireStep(DirectoryWalker.java:173)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:391)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385)
	at org.codehaus.plexus.util.DirectoryWalker.scan(DirectoryWalker.java:344)
	at org.apache.maven.archiva.repository.scanner.DefaultRepositoryScanner.scan(DefaultRepositoryScanner.java:120)
	at org.apache.maven.archiva.repository.scanner.DefaultRepositoryScanner.scan(DefaultRepositoryScanner.java:64)
	at org.apache.maven.archiva.scheduled.executors.ArchivaRepositoryScanningTaskExecutor.executeTask(ArchivaRepositoryScanningTaskExecutor.java:106)
	at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116)
	at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
	at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
	at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.maven.archiva.consumers.core.repository.RepositoryPurgeException: Invalid path to Artifact: filename format is invalid,expected timestamp format in filename.
	at org.apache.maven.archiva.consumers.core.repository.RetentionCountRepositoryPurge.process(RetentionCountRepositoryPurge.java:102)
	at org.apache.maven.archiva.consumers.core.repository.RepositoryPurgeConsumer.processFile(RepositoryPurgeConsumer.java:185)
	... 20 more
290885 [pool-2-thread-1] ERROR org.apache.maven.archiva.repository.scanner.RepositoryScanner:default  - Consumer [metadata-updater] had an error when processing file [D:\archiva-web\data\repositories\snapshots\org\irene\irene\2.0-SNAPSHOT\irene-2.0-20071214.204316-1-test-sources.jar]: Unable to convert to artifact reference: org\irene\irene\2.0-SNAPSHOT\irene-2.0-20071214.204316-1-test-sources.jar
org.apache.maven.archiva.consumers.ConsumerException: Unable to convert to artifact reference: org\irene\irene\2.0-SNAPSHOT\irene-2.0-20071214.204316-1-test-sources.jar
	at org.apache.maven.archiva.consumers.core.MetadataUpdaterConsumer.processFile(MetadataUpdaterConsumer.java:167)
	at org.apache.maven.archiva.repository.scanner.functors.ConsumerProcessFileClosure.execute(ConsumerProcessFileClosure.java:57)
	at org.apache.commons.collections.functors.IfClosure.execute(IfClosure.java:117)
	at org.apache.commons.collections.CollectionUtils.forAllDo(CollectionUtils.java:388)
	at org.apache.maven.archiva.repository.scanner.RepositoryScannerInstance.directoryWalkStep(RepositoryScannerInstance.java:138)
	at org.codehaus.plexus.util.DirectoryWalker.fireStep(DirectoryWalker.java:173)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:391)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385)
	at org.codehaus.plexus.util.DirectoryWalker.scanDir(DirectoryWalker.java:385)
	at org.codehaus.plexus.util.DirectoryWalker.scan(DirectoryWalker.java:344)
	at org.apache.maven.archiva.repository.scanner.DefaultRepositoryScanner.scan(DefaultRepositoryScanner.java:120)
	at org.apache.maven.archiva.repository.scanner.DefaultRepositoryScanner.scan(DefaultRepositoryScanner.java:64)
	at org.apache.maven.archiva.scheduled.executors.ArchivaRepositoryScanningTaskExecutor.executeTask(ArchivaRepositoryScanningTaskExecutor.java:106)
	at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116)
	at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
	at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
	at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.maven.archiva.repository.layout.LayoutException: Invalid path to Artifact: filename format is invalid,expected timestamp format in filename.
	at org.apache.maven.archiva.repository.content.DefaultPathParser.toArtifactReference(DefaultPathParser.java:134)
	at org.apache.maven.archiva.repository.content.AbstractDefaultRepositoryContent.toArtifactReference(AbstractDefaultRepositoryContent.java:49)
	at org.apache.maven.archiva.repository.content.ManagedDefaultRepositoryContent.toArtifactReference(ManagedDefaultRepositoryContent.java:330)
	at org.apache.maven.archiva.consumers.core.MetadataUpdaterConsumer.processFile(MetadataUpdaterConsumer.java:161)
	... 20 more

There are similar exceptions that follow right behind it with the only difference being that they are for:

  • D:\archiva-web\data\repositories\snapshots\org\irene\irene\2.0-SNAPSHOT\irene-2.0-20071214.204316-1-sources.jar
  • D:\archiva-web\data\repositories\snapshots\org\irene\irene\2.0-SNAPSHOT\irene-2.0-20071214.204316-1-tests.jar
  • D:\archiva-web\data\repositories\snapshots\org\irene\irene\2.0-SNAPSHOT\irene-2.0-20071214.204316-1.jar
  • D:\archiva-web\data\repositories\snapshots\org\irene\irene\2.0-SNAPSHOT\irene-2.0-20071214.204316-1.pom

Nothing is deleted however.

Issue Links

Activity

Hide
james ahlborn added a comment -

So, I've been poking through the source code looking for this problem.

The problem seems to be coming from DefaultPathParser, line ~131 (although that is hidden from the user because RetentionCountRepositoryPurge drops the original exception (line ~102), should be nesting the exception, not just copying the message.

here are the issues i've found so far:

in FileNameParser.java:

  • extensionPattern is bogus. I assume that the '.' chars are supposed to be literal chars, should be:

"([.]tar[.]gz$)|([.]tar[.]bz2$)|([.][a-z0-9]{1,4}$)"

  • nextVersion() is returning a version which will not succeed in VersionUtil.isUniqueSnapshot (called by DefaultPathParser). the nextVersion method returns a string like "999999999-999999-99", but the unique snapshot code is looking for "99999999.999999-99" (note the '.' separator). i haven't tested this directly, but it's also possible the nextVersion method may also be tacking "-test" onto the version string because the "test" in "test-sources" matches the VersionUtil.isVersion() method (from versionPatterns line ~47).

another minor point, in VersionUtil, the VersionMegaPattern should be pre-compiled like the other regular expressions (will probably speed things up). it's the most complicated expression and probably takes the longest to compile.

Show
james ahlborn added a comment - So, I've been poking through the source code looking for this problem. The problem seems to be coming from DefaultPathParser, line ~131 (although that is hidden from the user because RetentionCountRepositoryPurge drops the original exception (line ~102), should be nesting the exception, not just copying the message. here are the issues i've found so far: in FileNameParser.java:
  • extensionPattern is bogus. I assume that the '.' chars are supposed to be literal chars, should be:
"([.]tar[.]gz$)|([.]tar[.]bz2$)|([.][a-z0-9]{1,4}$)"
  • nextVersion() is returning a version which will not succeed in VersionUtil.isUniqueSnapshot (called by DefaultPathParser). the nextVersion method returns a string like "999999999-999999-99", but the unique snapshot code is looking for "99999999.999999-99" (note the '.' separator). i haven't tested this directly, but it's also possible the nextVersion method may also be tacking "-test" onto the version string because the "test" in "test-sources" matches the VersionUtil.isVersion() method (from versionPatterns line ~47).
another minor point, in VersionUtil, the VersionMegaPattern should be pre-compiled like the other regular expressions (will probably speed things up). it's the most complicated expression and probably takes the longest to compile.
Hide
Gayathri Muralidharan added a comment -

Hi,
We are using Archiva 1.3 and the snapshots are not getting purged due to this Layout exception.
Has this issue been fixed in 1.3.3 ??

Thanks,
Gayathri

Show
Gayathri Muralidharan added a comment - Hi, We are using Archiva 1.3 and the snapshots are not getting purged due to this Layout exception. Has this issue been fixed in 1.3.3 ?? Thanks, Gayathri
Hide
Gayathri Muralidharan added a comment -

Update : The same error occurs with 1.3.3 also.

Error message :2011-02-03 01:06:18,598 [pool-2-thread-1] INFO org.apache.maven.archiva.consumers.core.MetadataUpdaterConsumer - Not processing path that is not an artifact: abc/def/SNAPSHOT/def-20110130.110618-652.jar (Invalid path to Artifact: filename format is invalid,expected timestamp format in filename.)

Show
Gayathri Muralidharan added a comment - Update : The same error occurs with 1.3.3 also. Error message :2011-02-03 01:06:18,598 [pool-2-thread-1] INFO org.apache.maven.archiva.consumers.core.MetadataUpdaterConsumer - Not processing path that is not an artifact: abc/def/SNAPSHOT/def-20110130.110618-652.jar (Invalid path to Artifact: filename format is invalid,expected timestamp format in filename.)

People

Vote (5)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: