I inherited a largish Eclipse plugin codebase, which builds with Maven Tycho. The full build produces an update site for the plugin.
I've successfully tested the plugin by just running a test instance and specifying the plugins to load, but I'm now trying to install the plugin "normally" from the locally-built update site. In the update site entry, I specified the path to the zip file in the update-site target folder. It was able to present the list of features present in the update site (only the one). I checked that and continued. It got past the license approval and started to install, but then it failed with this:
An error occurred during the org.eclipse.equinox.internal.p2.engine.phases.CheckTrust phase. session context was:(profile=_home_opnfv_eclipse_java-neon_eclipse, phase=org.eclipse.equinox.internal.p2.engine.phases.CheckTrust, operand=, action=). Error reading signed content. error in opening zip file
From the .metadata/.log file, there is the following unsurprising stacktrace (excerpt):
!ENTRY org.eclipse.equinox.p2.engine 4 4 2016-02-10 18:22:49.495
!MESSAGE An error occurred during the org.eclipse.equinox.internal.p2.engine.phases.CheckTrust phase.
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2016-02-10 18:22:49.495
!MESSAGE session context was:(profile=_home_opnfv_eclipse_java-neon_eclipse, phase=org.eclipse.equinox.internal.p2.engine.phases.CheckTrust, operand=, action=).
!SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2016-02-10 18:22:49.495
!MESSAGE Error reading signed content.
!STACK 0
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.eclipse.osgi.internal.signedcontent.SignedBundleHook.getSignedContent(SignedBundleHook.java:209)
at org.eclipse.equinox.internal.p2.engine.phases.CertificateChecker.checkCertificates(CertificateChecker.java:73)
In searching for other occurrences of this, I've found various issues that seemed to be associated with this, but nothing concrete. I found a few people with the unsubstantiated advice to delete all the "artifacts.xml" files in the Eclipse distribution. As I didn't have any other suggestions, I tried that (saving them in a tar file first), and then restarted Eclipse, then reinstalled, but that had no effect.
I can't tell WHICH zip file this is complaining about. I imagine it's not the main update site zip. I looked at all the jar files present in "target/repository", and none of them are signed. It's not clear to me that they're supposed to be. As far as I know, the build process for this application should be producing a valid update site.
What other info can I provide that would illuminate this?
Update:
I tried removing one zip file from the equation by selecting "Local" instead of "Archive" when I created the update site entry in Eclipse, and instead of selecting "target/.zip", I selected "target/repository", which has the same content as the zip file. Unfortunately, this made no difference. Same error.
Update:
I have no idea whether this is significant, but I noticed that when Eclipse is attempting to install the plugin, it displays the seemingly innocuous "Install Details" page, which lists the plugins to be installed, but I happened to notice that below this plugin list is a "Size:" label, and the value on it is "0 bytes". Is this significant, and if so, what does that indicate?
Update:
After connecting a debugger to the target instance, I was able to discover that the corrupted jar is "$HOME/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar". This file is not zero length, but "jar" and "unzip" report that the file is corrupted. I found four other "org.eclipse.emf.*" jars with a similar problem, and all other jars in the p2 repo are fine.
Now that I know which files are corrupted, what can I do about this? I tried moving the corrupted jar files to another location (and carefully logging the information) and then restarting Eclipse and reinstalling the plugin. It still fails with an error in the "CheckTrust" phase, but this time it reports the full path for the missing jar file.
How do I repair these files? Do I have to find valid copies of them somewhere on the net?
(I've filed a bug report to add the full path to the corrupted zip file in the original exception report.)
CertificateChecker
this is just checking to see if the jar is signed, so the fact it is not signed is not the issue. – Rutland