spring-projects / sts4

The next generation of tooling for Spring Boot, including support for Cloud Foundry manifest files, Concourse CI pipeline definitions, BOSH deployment manifests, and more... - Available for Eclipse, Visual Studio Code, and Theia
https://spring.io/tools
Eclipse Public License 1.0
873 stars 205 forks source link

Unable to install STS4 on Eclipse 2021-03 #648

Closed dbnex14 closed 3 years ago

dbnex14 commented 3 years ago

Describe the bug We are running behind a proxy. Attempt to install STS4 on Eclipse 2021-03 fails with error: Unable to read repository at https://download.springsource.com/release/TOOLS/sts4/update/e4.19/content.xml. PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

To Reproduce

  1. Start Eclipse 2021-03
  2. Menu > Help > Eclipse Marketplace
  3. Search for "Springboot tools suite"
  4. Select SpringTools Suite 4 (aka Spring Tools Suite 4) 4.10.0.RELEASE
  5. Click on Install button
  6. "Confirm Selected Feature" popup shows listing STS4 features that will be installed, all are selected
  7. Click on "Confirm>" button

This results in the above error.

I have 2 versions of JDK installed on my system in C:\Program Files\Java

Following accepted answer instructions on this Stackoverflow https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ, I:

But adding certificate did not help, I am getting still the same error.

Also, If I go to eclipse market place website () and click the orange download button below STS to open "Update Site URL" box and copy the URL where it says "Add this URL to your Eclipse Installation to reach this solution's update site. 2021-03 (4.19)" into browser, I get following error:

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>RM671CKBEYD78Y12</RequestId>
<HostId>H91VMFfnoo/MXxns6iPpxoO3N2Zz4ATPUEfBlkAxH34ocbBa6Sa0pGudUqn4gAE5gSScEQWydVU=</HostId>
</Error>

Sample non-applicable

dbnex14 commented 3 years ago

Please close this issue. This was resolved by our security team which was blocking something.

dbnex14 commented 3 years ago

Closing, this was resolved by our security team, it looks like we were not able to reach market place url for sts

martinlippert commented 3 years ago

@dbnex14 Good news and thanks for letting us know. Glad to hear that you found the underlying issue.

Side note: The AccessDenied message that you see when putting the update site URL into a browser is correct, the update site doesn't serve any index page. It is designed to be accessed by the install/update mechanism by the underlying Eclipse platform only.

JonathanHortman commented 2 years ago

tengo el mismo problema

martinlippert commented 2 years ago

@JonathanHortman Can you share the details of your issue and what exactly you are doing?

Akashpawar-sky commented 3 weeks ago

Error while reading from repository: https://download.springso eclipse version: 2023-03 (4.27.0)

BoykoAlex commented 3 weeks ago

Hmm... I think 4.27 is older than we support at the moment... I think 4.30 is the oldest we support with the latest release. What's the p2 repo url?

martinlippert commented 3 weeks ago

You can find a list of all the update sites for all the various versions that we shipped here: https://github.com/spring-projects/sts4/wiki/Previous-Versions - but keep in mind that - as Alex said - Eclipse 2023-03 is no longer supported and the latest versions of the Spring Tools for Eclipse will most likely not even install on that old version.

ANPEFRE30 commented 1 week ago

Error while reading from repository: https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/e4.33/site.xml.

martinlippert commented 1 week ago

@ANPEFRE30 The URL that you mention does indeed not exist, but it is also not necessary. The install/update mechanism of the underlying Eclipse platform should try to read the content of the repository from https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/e4.33/compositeContent.xml instead, if there is no site.xml file.

In some cases, the 404 from https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/e4.33/site.xml is not being reported correctly to the install/update mechanism, for example if there is a proxy server in between in your network environment that causes trouble.

martinlippert commented 1 week ago

As a side note, you can always install a ready-to-use distribution of the latest Eclipse release with the Spring Tools pre-installed from https://spring.io/tools

AndreaConcetti commented 1 week ago

i am also getting the Error while reading from repository: https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/e4.33/site.xml.. I tried many solutions including the reloading and deleting of the software site in Install/Update section. Nothign seems to be working. I'm using Eclipse 4.32 , is it a version problem?

martinlippert commented 1 week ago

@AndreaConcetti Do you have a direct network connection or is there a company network and/or proxy server involved?

The URL that you mentioned should not be listed in the preferences. What do you have listed there?

As a side note: The latest Eclipse version is 4.33. So if you want to update to that, you should have:

listed in the preferences. There is no other update site URL needed from cdn.spring.io. If there is anything else listed, feel free to remove that (permanently).

If you want to stay on Eclipse 4.32, you could use

instead of the latest one mentioned above, but that one is pointing directly to the 4.25.0 release of the Spring Tools and will not move to a new release.

AndreaConcetti commented 1 week ago

i have direct network , trying the URL you gave for 4.32 gives this error: Error while reading from repository: https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/4.25.0.RELEASE/e4.32/site.xml. Error while reading from repository: https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/4.25.0.RELEASE/e4.32/site.xml. Using the latest ide everything worked fine.

martinlippert commented 1 week ago

What happens if you select this update site URL and press reload (in the preferences dialog)? Does it produce the same error message?

AndreaConcetti commented 1 week ago

Error while reading from repository: https://download.springsource.com/release/TOOLS/update/e4.12/site.xml. Error while reading from repository: https://download.springsource.com/release/TOOLS/update/e4.12/site.xml. it shows this when i press reload. I've decided to use the new eclipse ide version, but if you need any more information i'll try to provide it,

martinlippert commented 1 week ago

@AndreaConcetti Thanks for helping us tracking this down. What happens if you only select https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/latest from the list of update sites and press Reload? Does that work?

Please deselect everything else from the list of update sites before doing that. The one you mentioned above seems to be a very old one, from e4.12, which is outdated for a long time now.

AndreaConcetti commented 1 week ago

i tried deselecting all and using the URL you provided, it shows this error: Error while reading from repository: https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/latest/site.xml. Error while reading from repository: https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/latest/site.xml.

martinlippert commented 1 week ago

@AndreaConcetti Thanks for checking this, much appreciated. I am not surprised to see that the p2 mechanism tries to access this URL extension (site.xml) (it tries various URLs to find out what kind of repository the URL points at). But the URL returns a 404, which indicates to the mechanism to go on and try the next possible URL extension - instead of reporting an error. That is why I am puzzled about the error showing up.

But since you mentioned that the latest install of the IDE works as expected, the problem might be rooted inside of the network access code of the old installation that you had before, so somewhat difficult to find the exact root cause here. Sorry. Hope you can continue with the new install just fine.

SenCodeMaker commented 1 week ago

hello @martinlippert I'm having a similar issue for a month now. impossible for me to install STS4 on latest eclipse thourt the marketplace I received a network error.

in fact when I try any of the URLs cited in the install wiki I end up with a 404, for example https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/4.25.0.RELEASE/e4.33/ yield

image

I also tried this same url by another network with my personal smartphone I have the same 404

on another hand the self contained jar of sts build over eclipse downloads correctly

martinlippert commented 1 week ago

@SenCodeMaker The repository URL on its own returns a 404 and that is correct. There is no index file served for this URL. The update mechanism of Eclipse will try to find specific files at this URL, like site.xml and others.

In case of the Spring Tools for Eclipse repositories, it is a composite update repository, which the update mechanism uses via https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/latest/compositeContent.xml (for example). Therefore, seeing a 404 when you put the repository URL in a browser is expected.

The mechanism takes the base repository URL that you have in your preferences (https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/latest/) and checks if those extensions are available or not.

The content at https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/4.25.0.RELEASE/e4.33, for example, is listed via https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/4.25.0.RELEASE/e4.33/content.jar. If you put those URLs into the browser, it should download the JAR file (or show the content of the XML file in the case above).

This does not explain why installing plugins from the Marketplace or via the Install New Software dialog fails though.

martinlippert commented 1 week ago

I tried this again, let me describe in detail what I did and what seems to work. Maybe you can try to try the exact same steps to see if those behave differently for you.

This resulted in a successful install of the Spring Tools into my Eclipse installation. Can you try the exact same steps?

SenCodeMaker commented 1 week ago

just didi this is that I got :

image

martinlippert commented 1 week ago

Aaaah, that provides interesting details... :-)

First of all, the dialog mentions e4.32, which looks like you are using an Eclipse 2024-06 install, not the 2024-09 one. But that is just a side note, probably not relevant for the issue.

Second, the interesting part of the error below is the sentence about PKIX path building failed, which points at certificate problems between the runtime that your IDE uses and the certificate that is used by the update repository URL. Can you double check which JDK is used to run the IDE? You can find that out via the about menu: About Eclipse -> Installation Details -> Configuration (tab) and then look for the java.home= line. What does it point at?

On StackOverflow, there are various questions/answers to try around this issue, e.g. https://stackoverflow.com/questions/76237322/pkix-sun-certification-issues-with-eclipse - maybe that provides additional details and suggestions what to try.

SenCodeMaker commented 1 week ago

EDIT: I had misplaced the certificate option in eclipse.ini. it actually corrected the issue thx you very much !

hello again thx for the analysis :) I tried installing actually eclipse 09/24 and had same issue so I looked at the config. it's using openjdk auto downloaded in the pool : .p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_21.0.4.v20240802-1551/jre/bin

I tried:

  1. to configure -Djavax.net.ssl.trustStoreType=Windows-ROOT like in the stack mentionned and
  2. to config to use another adopjdk 21 installed elsewhere on my pc

but I got the same certificate issue

SenCodeMaker commented 1 week ago

now I succedded and after two hours of searching I still have the issue that spring nature is not kicking for my project even if it's a springboot project well building with java 21 & maven. I can't add it with right click menu nothing shows;

i actually don't have springboot dash board menu even if the install worked and I can see the plugin in the eclipse details

martinlippert commented 5 days ago

@SenCodeMaker There is no Eclipse project nature anymore in Spring Tools 4, it works in a different way. In case you are migrating from the previous Spring Tool Suite 3, please take a look at https://github.com/spring-projects/sts4/wiki/STS3-Migration.

The overall recommendation is to start with a fresh Spring Tools 4 distribution from https://spring.io/tools and re-import projects into a fresh workspace. The old Spring nature is not there anymore, so you would have to remove references to that nature from your project definition files.

The Spring Boot dashboard is just a view that you can get via the Spring Boot Dashboard icon in your toolbar or via the Window -> Show View menu. There is also no dedicated Spring perspective anymore, the Spring views integrate with the standard Java perspective instead.

Hope this helps!