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

Eclipse plugin installation broke #371

Closed
hohwille opened this issue Mar 20, 2020 · 10 comments
Closed

Eclipse plugin installation broke #371

hohwille opened this issue Mar 20, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@hohwille
Copy link
Member

We created devonfw-ide to automate setup and update of development tooling and its configurations. To make everything flexible and portable we automated vanilla installation of Eclipse and additional installation of plugins. All works fine in general.

However, now projects configured custom plugins like WST, SonarLint, JBoss Tools, etc. for Eclipse in their project settings git. After this worked initially changes to the update sites applied that broke the automated plugin installations:

Installing eclipse plugin http://download.eclipse.org/releases/2019-09 from org.eclipse.wst.common_ui.feature.feature.group,org.eclipse.wst.common_core.feature.feature.group,org.eclipse.wst.json_ui.feature.feature.group,org.eclipse.wst.server_core.feature.feature.group,org.eclipse.wst.server_ui.feature.feature.group,org.eclipse.wst.web_core.feature.feature.group,org.eclipse.wst.web_ui.feature.feature.group,org.eclipse.wst.xml_core.feature.feature.group,org.eclipse.wst.xml_ui.feature.feature.group,org.eclipse.m2e.wtp.feature.feature.group
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.

ATTENTION ********
WARNING: Installation of plugin http://download.eclipse.org/releases/2019-09 failed. Please try to install manually.

Installing eclipse plugin https://eclipse-uc.sonarlint.org from org.sonarsource.sonarlint.core.sonarlint-client-api,org.sonarsource.sonarlint.core.sonarlint-core,org.sonarlint.eclipse.ui,org.sonarlint.eclipse.cdt,org.sonarlint.eclipse.core,org.sonarlint.eclipse.jdt,org.sonarlint.eclipse.m2e
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.

ATTENTION ********
WARNING: Installation of plugin https://eclipse-uc.sonarlint.org failed. Please try to install manually.

Installing eclipse plugin http://downloads.sonarsource.com/eclipse/eclipse/ from org.codehaus.sonar.ws-client,org.sonar.ide.eclipse.ui,org.sonar.ide.eclipse.common,org.sonar.ide.eclipse.core,org.sonar.ide.eclipse.jdt,org.sonar.ide.eclipse.m2e,org.codehaus.sonar.runner.sonar-runner-api
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.

ATTENTION ********
WARNING: Installation of plugin http://downloads.sonarsource.com/eclipse/eclipse/ failed. Please try to install manually.

It appears the root cause of these problems is this one:

java.lang.IllegalArgumentException: Neither raw version nor format was specified: download.eclipse.org
at org.eclipse.equinox.internal.p2.metadata.VersionParser.parse(VersionParser.java:155)
at org.eclipse.equinox.p2.metadata.Version.create(Version.java:96)
at org.eclipse.equinox.p2.metadata.Version.parseVersion(Version.java:164)
at org.eclipse.equinox.p2.metadata.VersionedId.<init>(VersionedId.java:62)
at org.eclipse.equinox.p2.metadata.VersionedId.parse(VersionedId.java:49)
at org.eclipse.equinox.internal.p2.director.app.DirectorApplication.parseIUsArgument(DirectorApplication.java:230)
...

Seems to be related to this issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=431087

@hohwille hohwille added the bug Something isn't working label Mar 20, 2020
@UdoW
Copy link

UdoW commented Mar 20, 2020

The error occurs if a feature entry in the file category.xml contains a syntactically wrong version value. I.e. if the version value can not be parsed to a version.
It would be nice if there would be an error message showing that the format is wrong and in which file.

A category.xml is used in a project with packaging type eclipse-repository. It defines the features which are contained in this p2 repository.

@hohwille
Copy link
Member Author

@UdoW Thanks for your kind explanation 👍
So e.g. for https://download.eclipse.org/releases/2019-09/ where would I find the category.xml is it "hidden" inside a JAR file or how could I check what is actually wrong here?

@hohwille
Copy link
Member Author

hohwille commented Mar 20, 2020

https://download.eclipse.org/releases/2019-09/context.xml leads to 404
http://download.eclipse.org/releases/2019-09/compositeContent.jar contains a file called compositeContent.xml with this content:

<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='Eclipse Repository' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeMetadataRepository' version='1.0.0'>
  <properties size='3'>
    <property name='p2.timestamp' value='1313779613118'/>
    <property name='p2.compressed' value='true'/>
    <property name='p2.atomic.composite.loading' value='true'/>
  </properties>
  <children size='2'>
    <child location='../../technology/epp/packages/2019-09/'/>
    <child location='201909181001' />
  </children>
</repository>

Still no clue where to find that category.xml. Maybe the problem acutally is that the file is missing?

@hohwille
Copy link
Member Author

@UdoW
Copy link

UdoW commented Mar 20, 2020

category.xml is not part of a p2 repository. You need it to create a new p2 repository, so it is part of your source project.

@hohwille
Copy link
Member Author

@UdoW thanks for your feedback and clarifiaction.
The stacktrace (see above)

java.lang.IllegalArgumentException: Neither raw version nor format was specified: download.eclipse.org

Lead me to https://bugs.eclipse.org/bugs/show_bug.cgi?id=431087
Now, I understand that that Exception can more or less mean anything that went wrong. So hunting for category.xml lead me on the wrong track. In the end with the little details and context Eclipse is providing for the error it seems hard to trace down what is actually wrong now while it used to work for some time. Something in the official p2 repo of Eclipse and the three others listed here has changed and since then the automated plugin installation fails. That is all we know but no clue why or how to fix or workaround the problem.

@maybeec
Copy link
Member

maybeec commented Mar 28, 2020

I could not recover what command line is executed here, but does this help? https://stackoverflow.com/questions/16406807/install-google-eclipse-plugin-from-command-line-using-archive-of-the-update-site

@markusschuh
Copy link
Member

This is just a side effect of the fix for #346, isn't it? The order of options for the add-plugin changed - but this project's ide settings seem still to use the older order of options.

So now the import application org.eclipse.equinox.p2.director is called by mistake with -installIU http://download.eclipse.org/releases/2019-09. This option expects a feature string (with optional "/" suffix and is not happy with this repository URI, hence the error:

java.lang.IllegalArgumentException: Neither raw version nor format was specified: download.eclipse.org

It might help, if the - now - wrong order were detected by the `add-plugin - e.g. by checking the URI parameter for "feature.group" - and answered with a clearer error message.

@hohwille
Copy link
Member Author

hohwille commented Apr 22, 2020

OMG. Thanks @markusschuh, you are completely correct. I was thinking that I only switched this for the CLI and not for DEVON_ECLIPSE_PLUGINS but you are completely right.
After all the entire approach is error-prone/deprecated and replaced with a new approach:
https://github.com/devonfw/ide/blob/master/documentation/eclipse.asciidoc#plugins

So I will simply migrate in my project.
So the actual bug is IMHO that with #346 I introduced an incompatibility.
I assume that besides my project only one or two other projects are currently using this special feature so far. I could write a fix checking if the featureIDs from DEVON_ECLIPSE_PLUGINS start with "http" and in that case swap the pairs from the array, but maybe we could even close this issue as is an encourage projects to use the new approach. This array style variable config was a design-flaw on my end from the start.

@hohwille
Copy link
Member Author

I am closing this now. Issue is understood, workaround/configuration fix and reasonable replacement for much better and more maintainable config is available.

@hohwille hohwille added this to the release:2020.04.001 milestone Apr 27, 2020
@hohwille hohwille changed the title Eclipse update sites and plugin ecosystem is unstable Eclipse plugin installation broke Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants