eclipse-platform / .github

Common contribution content for eclipse-platform repositories
https://www.eclipse.org/eclipse/
5 stars 10 forks source link

java.lang.UnsupportedOperationException in org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationArtifactRepository #117

Open jukzi opened 1 year ago

jukzi commented 1 year ago

While Oomphing platform i repeatedly get error box: image

eclipse.buildId=4.28.0.I20230417-1800
java.version=19.0.2
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data C:\Users\JKubitz\eclipseDev\platform-sdk20230418\Latest

org.eclipse.core.jobs
Error
Tue Apr 18 10:05:39 CEST 2023
An internal error occurred during: "Install download1".

java.lang.UnsupportedOperationException
    at org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationArtifactRepository.removeDescriptor(ExtensionLocationArtifactRepository.java:191)
    at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.perform(MirrorRequest.java:179)
    at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:773)
    at org.eclipse.equinox.internal.p2.artifact.repository.simple.DownloadJob.run(DownloadJob.java:64)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
merks commented 1 year ago

Better to report this as a p2 problem. This code in MirrorRequest.perform assumes that remove will work:

        // failed, first remove possibly erroneously added descriptor
        if (target.contains(destinationDescriptor))
            target.removeDescriptor(destinationDescriptor);

This looks like it will be tricky to reproduce... Probably it should catch such an exception to ignore removal...

laeubi commented 5 months ago

This looks like it will be tricky to reproduce... Probably it should catch such an exception to ignore removal...

There must be something broken on another part... I looked in the code and what happens is that it downloads (or try to download) a descriptor but that fails, as downloading will add a descriptor to the repository it tries to now remove that descriptor again what fails because ExtensionLocationArtifactRepository claims it is not modifiable, but in that case one should not try to download / mirror to this repository anyways.

laeubi commented 5 months ago

Looking at the stracktrace at laest the at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:773)

point not to a valid line...

laeubi commented 5 months ago

Also at org.eclipse.equinox.internal.p2.artifact.repository.simple.DownloadJob.run(DownloadJob.java:64) does not point to a valid line so it seems at laes this stacktrace is not from a latest ibuild, if I look there it seems something is confused there because the DownloadJob uses an SimpleArtifactRepository but the Artifact request seem to target the ExtensionLocationArtifactRepository what itself declares as unmodifiable here...