Community
Participate
Working Groups
I have a matrix job in Hudson that run a dozen Tycho 0.16 builds in parallel using Maven 3.0.4. All builds use the same target platform configuration and the same local Maven repository. When I triggered the matrix job almost all builds failed with the error below. I suspect the error was caused by another job performing the same rename operation but it's also strange that it's trying to rename the file to the same name: /work/hudson/node/home/.m2/repository/.cache/tycho/p2-repository-metadata/downloading/content-690616077.xml could not be renamed to /work/hudson/node/home/.m2/repository/.cache/tycho/p2-repository-metadata/downloading/content-690616077.xml [INFO] Computing target platform for MavenProject: ... [INFO] Adding repository https://... [INFO] Adding repository https://... [INFO] o.h.m.e.h.MavenExecutionResultHandler - Build failed with exception(s) [INFO] o.h.m.e.h.MavenExecutionResultHandler - [1] org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to resolve target definition /work/hudson/node/home/.m2/repository/.../my-target.target [DEBUG] Closing connection to remote [ERROR] Internal error: java.lang.RuntimeException: Failed to resolve target definition /work/hudson/node/home/.m2/repository/.../my-target.target: Failed to load metadata repository from location https://.../: An error occurred while downloading https://.../content.xml. The cache file /work/hudson/node/home/.m2/repository/.cache/tycho/p2-repository-metadata/downloading/content-690616077.xml could not be renamed to /work/hudson/node/home/.m2/repository/.cache/tycho/p2-repository-metadata/downloading/content-690616077.xml. -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to resolve target definition /work/hudson/node/home/.m2/repository/.../my-target.target at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: java.lang.RuntimeException: Failed to resolve target definition /work/hudson/node/home/.m2/repository/.../my-target.target at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.addTargetFileContentToTargetPlatform(P2TargetPlatformResolver.java:338) at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.computeTargetPlatform(P2TargetPlatformResolver.java:207) at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:94) at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:82) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) ... 11 more Caused by: org.eclipse.tycho.p2.target.facade.TargetDefinitionResolutionException: Failed to load metadata repository from location https://.../ at org.eclipse.tycho.p2.target.TargetDefinitionResolver.loadRepository(TargetDefinitionResolver.java:190) at org.eclipse.tycho.p2.target.TargetDefinitionResolver.resolveContent(TargetDefinitionResolver.java:109) at org.eclipse.tycho.p2.target.TargetDefinitionResolverService.resolveFromArguments(TargetDefinitionResolverService.java:64) at org.eclipse.tycho.p2.target.TargetDefinitionResolverService.getTargetDefinitionContent(TargetDefinitionResolverService.java:54) at org.eclipse.tycho.p2.target.TargetPlatformBuilderImpl.addTargetDefinition(TargetPlatformBuilderImpl.java:289) at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.addTargetFileContentToTargetPlatform(P2TargetPlatformResolver.java:331) ... 16 more Caused by: org.eclipse.equinox.p2.core.ProvisionException: An error occurred while downloading https://.../content.xml. The cache file /work/hudson/node/home/.m2/repository/.cache/tycho/p2-repository-metadata/downloading/content-690616077.xml could not be renamed to /work/hudson/node/home/.m2/repository/.cache/tycho/p2-repository-metadata/downloading/content-690616077.xml. at org.eclipse.equinox.internal.p2.repository.CacheManager.updateCache(CacheManager.java:371) at org.eclipse.equinox.internal.p2.repository.CacheManager.createCache(CacheManager.java:208) at org.eclipse.tycho.p2.remote.TychoP2RepositoryCacheManager.createCache(TychoP2RepositoryCacheManager.java:62) at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory.getLocalFile(SimpleMetadataRepositoryFactory.java:66) at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory.load(SimpleMetadataRepositoryFactory.java:88) at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad(MetadataRepositoryManager.java:57) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:758) at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:651) at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96) at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:92) at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:82) at org.eclipse.tycho.p2.target.TargetDefinitionResolver.loadRepository(TargetDefinitionResolver.java:188) ... 21 more
making the p2 access to local repo content/cache files multi-process safe was not covered by the work done in bug 347963. Not sure if this can be done in tycho or has to be fixed in p2. I think the main scenario in p2 (IDE install/update) does not have multi-process access to metadata cache files.
> I suspect the error was caused by another job performing the same rename > operation but it's also strange that it's trying to rename the file to the > same name: the cache file name is calculated from the repo URL AFAIK.
Unfortunately it's still not possible to use shared local Maven caches due to that bug and others. We are also seeing JVM crashes related to opened zip files being changed by other processes.
(In reply to comment #3) > Unfortunately it's still not possible to use shared local Maven caches due > to that bug and others. We are also seeing JVM crashes related to opened zip > files being changed by other processes. note that maven core still does not support multi-process access to local maven repo http://wiki.eclipse.org/Tycho/Release_Notes/0.14 regardless of what we are fixing in tycho, you may still see issues with maven core. That said, this bug is valid and should be fixed.
(In reply to comment #1) > Not sure if this can be done in tycho or has to be fixed in p2. > I think the main scenario in p2 (IDE install/update) does not have multi-process > access to metadata cache files. We are using our own p2 artifact repository implementation, so this should be possible. IMHO, a start would be to provide unit tests that reproduces the problem. That test would need to write into multiple LocalArtifactRepository instances that persist in the same file system location. Good contributions are welcome. [1] [1] http://wiki.eclipse.org/Tycho/Contributor_Guide
(In reply to comment #3) > Unfortunately it's still not possible to use shared local Maven caches due to > that bug and others. We are also seeing JVM crashes related to opened zip files > being changed by other processes. Yes, I can see how this can happen: A second build process may download to an artifact file which has just been downloaded (and is being used) by the first build process. I've opened bug 397355 to address this problem. The problem reported here however is different: As stated before (comment #1), this bug is about conflicting access to the local copies of remote repository index files. This index caching is done by one of the standard p2 repository implementations and not by our own implementation, so we really may need to fix this in the p2 code. (My last comment was wrong about this.)
+1
*** Bug 426697 has been marked as a duplicate of this bug. ***
Note, the file name is actually not the same, but the error message is wrong. It is created from the following template: "An error occurred while downloading {0}. The cache file {1} could not be renamed to {1}."
Reproduced on Tycho 0.23.1. No parralel builds were active.
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required. 0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done if issue is still present when latest release: * Create a new issue at https://github.com/eclipse/tycho/issues/ ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience) ** In the GitHub description, start with a link to this bugzilla ticket ** Optionally add new content to the description if it can helps towards resolution ** Submit GitHub issue * Update bugzilla ticket ** Add to "See also" property (up right column) the link to the newly created GitHub issue ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>" ** Set status as CLOSED MOVED ** Submit All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.