Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tycho 2.7.0 creates corrupt metadata in ~/.m2 (IllegalArgumentException: bundleLocation not found) #725

Closed
sratz opened this issue Mar 7, 2022 · 12 comments
Milestone

Comments

@sratz
Copy link
Contributor

sratz commented Mar 7, 2022

Tycho 2.7.0 creates metadata in ~/.m2 that is inconsistent and breaks other builds that still use Tycho 2.6.0:

Steps to reproduce:

  1. rm -rf ~/.m2/repository to start with a clean slate
  2. Grab eclipse.platform.ui, checkout latest master branch, build using mvn clean verify -Pbuild-individual-bundles -DskipTests This will build using Tycho 2.7.0.
  3. git checkout R4_22. Try to build again: mvn clean verify -Pbuild-individual-bundles -DskipTests. This time Tycho 2.6.0 is used.

This results in the following exception:

[INFO] Resolving class path of MavenProject: eclipse.platform.ui:org.eclipse.core.databinding:1.10.100-SNAPSHOT @ /home/user/git/eclipse.platform.ui/bundles/org.eclipse.core.databinding/.polyglot.META-INF
[ERROR] Internal error: java.lang.IllegalArgumentException: bundleLocation not found: /home/user/.m2/repository/org/eclipse/orbit/bundles/com.ibm.icu/67.1.0-SNAPSHOT/com.ibm.icu-67.1.0-SNAPSHOT.jar -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalArgumentException: bundleLocation not found: /home/user/.m2/repository/org/eclipse/orbit/bundles/com.ibm.icu/67.1.0-SNAPSHOT/com.ibm.icu-67.1.0-SNAPSHOT.jar
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalArgumentException: bundleLocation not found: /home/user/.m2/repository/org/eclipse/orbit/bundles/com.ibm.icu/67.1.0-SNAPSHOT/com.ibm.icu-67.1.0-SNAPSHOT.jar
    at org.eclipse.tycho.core.osgitools.EquinoxResolver.loadManifest (EquinoxResolver.java:497)
    at org.eclipse.tycho.core.osgitools.EquinoxResolver.newState (EquinoxResolver.java:352)
    at org.eclipse.tycho.core.osgitools.EquinoxResolver.newResolvedState (EquinoxResolver.java:126)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getResolverState (OsgiBundleProject.java:326)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolveClassPath (OsgiBundleProject.java:196)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:173)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.lambda$resolveProjects$0 (TychoMavenLifecycleParticipant.java:147)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.WhileOps$1$1.accept (WhileOps.java:99)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance (ArrayList.java:1632)
    at java.util.stream.ReferencePipeline.forEachWithCancel (ReferencePipeline.java:127)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (AbstractPipeline.java:502)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:488)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.resolveProjects (TychoMavenLifecycleParticipant.java:178)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:105)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException

This seems to be caused by the new metadata written in .m2/repository/p2/osgi/bundle/com.ibm.icu/67.1.0.v20200706-1749/com.ibm.icu-67.1.0.v20200706-1749-p2artifacts.xml:

<?xml version='1.0' encoding='UTF-8'?>
<?artifactRepository version='1.1.0'?>
<artifacts size='1'>
  <artifact classifier='osgi.bundle' id='com.ibm.icu' version='67.1.0.v20200706-1749'>
    <properties size='8'>
      <property name='artifact.size' value='13569732'/>
      <property name='download.size' value='13569732'/>
      <property name='maven-groupId' value='org.eclipse.orbit.bundles'/>
      <property name='maven-artifactId' value='com.ibm.icu'/>
      <property name='maven-version' value='67.1.0-SNAPSHOT'/>
      <property name='download.md5' value='a806129f0617555cbe037eb67a256800'/>
      <property name='download.checksum.md5' value='a806129f0617555cbe037eb67a256800'/>
      <property name='download.checksum.sha-256' value='b04fd26b370a2df5139c02ba99ee66580e133b1f4f4cdb64883649e8ef771ae7'/>
    </properties>
  </artifact>
</artifacts>

It points to maven-groupId org.eclipse.orbit.bundles, but there is nothing there in ~/.m2/repository/org/eclipse/orbit/bundles/com.ibm.icu/

@laeubi
Copy link
Member

laeubi commented Mar 7, 2022

Tycho 2.7.0 creates metadata in ~/.m2 that is inconsistent

Tycho does not create this metadata, it is copied from the updatesite that contains invalid data see for example https://bugs.eclipse.org/bugs/show_bug.cgi?id=578449

if you want to use tycho 2.6 and tycho 2.7 in parallel you need to use distinct maven local repositories for each of those.

@sratz
Copy link
Contributor Author

sratz commented Mar 7, 2022

if you want to use tycho 2.6 and tycho 2.7 in parallel you need to use distinct maven local repositories for each of those.

Is this documented somewhere? I hadn't cleared my ~/.m2/repository in years and have been using several Tycho versions (0.x, 1.x, 2.x) in parallel without issue. Why is this necessary now?

Actually, I can reproduce this issue with just 2.7.0:

  1. Start with clean ~/.m2/repostiory
  2. Again, build eclipse.platform.ui using latest master (using Tycho 2.7.0)
  3. Now, try to build Tycho 2.7.0 itself using Tycho 2.7.0: ~/git/tycho (tycho-2.7.x)$ mvn clean install -DskipTests
[ERROR] Internal error: java.lang.IllegalArgumentException: bundleLocation not found: /home/user/.m2/repository/org/eclipse/equinox/org.eclipse.equinox.registry/3.11.100-SNAPSHOT/org.eclipse.equinox.registry-3.11.100-SNAPSHOT.jar -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalArgumentException: bundleLocation not found: /home/user/.m2/repository/org/eclipse/equinox/org.eclipse.equinox.registry/3.11.100-SNAPSHOT/org.eclipse.equinox.registry-3.11.100-SNAPSHOT.jar
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.IllegalArgumentException: bundleLocation not found: /home/user/.m2/repository/org/eclipse/equinox/org.eclipse.equinox.registry/3.11.100-SNAPSHOT/org.eclipse.equinox.registry-3.11.100-SNAPSHOT.jar
    at org.eclipse.tycho.core.osgitools.EquinoxResolver.loadManifest (EquinoxResolver.java:497)
    at org.eclipse.tycho.core.osgitools.EquinoxResolver.newState (EquinoxResolver.java:352)
    at org.eclipse.tycho.core.osgitools.EquinoxResolver.newResolvedState (EquinoxResolver.java:126)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getResolverState (OsgiBundleProject.java:326)
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolveClassPath (OsgiBundleProject.java:196)
    at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:173)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.lambda$resolveProjects$0 (TychoMavenLifecycleParticipant.java:147)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept (ForEachOps.java:183)
    at java.util.stream.WhileOps$1$1.accept (WhileOps.java:99)
    at java.util.ArrayList$ArrayListSpliterator.tryAdvance (ArrayList.java:1632)
    at java.util.stream.ReferencePipeline.forEachWithCancel (ReferencePipeline.java:127)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel (AbstractPipeline.java:502)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:488)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.resolveProjects (TychoMavenLifecycleParticipant.java:178)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:105)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

@laeubi
Copy link
Member

laeubi commented Mar 7, 2022

3. Now, try to build Tycho 2.7.0 itself using Tycho 2.7.0

Tycho 2.7. build uses Tycho 2.6 thats why you see the failure there.

Why is this necessary now?

Because Tycho 2.6 and below do not support handling of bad p2 maven meta-data.

@sratz
Copy link
Contributor Author

sratz commented Mar 7, 2022

Ah, I see.

Too bad. This complicates things a bit. My current workaround is to just throw away ~/.m2/repository/p2 instead of the full ~/.m2/repository.

I guess this can be closed then.

@laeubi
Copy link
Member

laeubi commented Mar 7, 2022

It actually is enough to delete ~/.m2/repository/.meta/p2-artifacts.properties

This complicates things a bit.

Yeah thats quite bad, my hope is, no that it is visible some of the bad meta might get fixed in the meanwhile.
The only other option would be to have 2.6.1 that can handle the bad meta-data but actually almost never have had backports as there is no real support for them.

@hd42
Copy link
Contributor

hd42 commented Mar 8, 2022

We encountered a similar problem ([ERROR] Internal error: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: bundleLocation not found: /home/jenkins-slave/.m2/repository/org/eclipse/orbit/bundles/com.ibm.icu/63.1.0-SNAPSHOT/com.ibm.icu-63.1.0-SNAPSHOT.jar) and deleting ~/.m2/repository/.meta/p2-artifacts.properties seems to help. This should definitely be documented in the 2.7 release notes.

@mickaelistria
Copy link
Contributor

This should definitely be documented in the 2.7 release notes.

Can you please submit a PR for that?

@hd42
Copy link
Contributor

hd42 commented Mar 8, 2022

Is hd42#1 sufficient, @mickaelistria ?

@mickaelistria
Copy link
Contributor

Yes, it seems good enough and for sure better than the current state, so please turn it into a PR ;)

@hd42
Copy link
Contributor

hd42 commented Mar 8, 2022

Sorry, I had the wrong repo. See #738

@laeubi
Copy link
Member

laeubi commented Mar 10, 2022

@sratz is the adjusted release notes sufficient for you?

@sratz
Copy link
Contributor Author

sratz commented Mar 11, 2022

Yes, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants