You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@archiva.apache.org by "james ahlborn (JIRA)" <ji...@codehaus.org> on 2008/02/18 22:57:28 UTC

[jira] Commented: (MRM-632) Repository Purge Consumer throws Invalid Path to Artifact

    [ http://jira.codehaus.org/browse/MRM-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_124202 ] 

james ahlborn commented on MRM-632:
-----------------------------------

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.

> Repository Purge Consumer throws Invalid Path to Artifact
> ---------------------------------------------------------
>
>                 Key: MRM-632
>                 URL: http://jira.codehaus.org/browse/MRM-632
>             Project: Archiva
>          Issue Type: Bug
>          Components: repository scanning
>    Affects Versions: 1.0
>         Environment: Tomcat 6.0.14
> Windows Server 2003
>            Reporter: Luke Amdor
>             Fix For: 1.0.2
>
>
> 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:
> {noformat}
> 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
> {noformat}
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira