Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Get error in "CheckTrust" phase will installing from local update site
Get error in "CheckTrust" phase will installing from local update site [message #1723022] Thu, 11 February 2016 02:26 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
I've inherited an Eclipse plugin codebase. I'm able to test it by running a test instance and specifying the plugins to load. I'm also able to build the entire update site from Maven. I'm now trying to install the plugin from the update site in a separate Eclipse instance.

Eclipse is able to see the plugin, and I can specify to install it, but when it proceeds to do this, it fails with the following:
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


So I'm missing something either in the build step, or the configuration of the Eclipse instance I'm trying to install this into. It obviously has something to do with signatures, but I don't know what's wrong, or the process for fixing it.
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723023 is a reply to message #1723022] Thu, 11 February 2016 04:25 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Just so it's clear, I had previously installed a version of this plugin from a remote update site before installing this version from the local update site. From what I've read, Eclipse has trouble with this scenario, and fixing it requires hacking on some "feature" or "artifacts" files. I'm lacking clear information on exactly how to resolve this.
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723246 is a reply to message #1723023] Fri, 12 February 2016 17:02 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Two more pieces of information.

To eliminate one potential zip file from consideration, I tried instead of selecting "Archive" and locating the zip file containing the update site, I selected the "target/repository" folder, which has the same content as the zip file. Unfortunately, this got the same error.

This is the stacktrace from the .metadata/.log file:
!ENTRY org.eclipse.equinox.p2.engine 4 4 2016-02-12 08:56:50.744
!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-12 08:56:50.744
!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-12 08:56:50.744
!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)
	at org.eclipse.equinox.internal.p2.engine.phases.CertificateChecker.start(CertificateChecker.java:54)
	at org.eclipse.equinox.internal.p2.engine.phases.CheckTrust.completePhase(CheckTrust.java:50)
	at org.eclipse.equinox.internal.p2.engine.Phase.postPerform(Phase.java:251)
	at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:101)
	at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:47)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:75)
	at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
	at org.eclipse.equinox.p2.operations.ProvisioningSession.performProvisioningPlan(ProvisioningSession.java:175)
	at org.eclipse.equinox.p2.operations.ProfileModificationJob.runModal(ProfileModificationJob.java:79)
	at org.eclipse.equinox.p2.operations.ProvisioningJob.run(ProvisioningJob.java:177)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


I posted the same question on StackOverflow, and I did get one comment from someone who examined some of the code at the top of the stack and concluded that this isn't an issue with signing.

Re: Get error in "CheckTrust" phase will installing from local update site [message #1723250 is a reply to message #1723246] Fri, 12 February 2016 17:38 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
I happened to notice that when Eclipse displays the "Install Details" page, showing the plugins it's going to try to install, there is an innocuous label below the plugins table, showing "Size: 0 bytes". I don't know what that indicates, but it seems like it might be a clue.
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723612 is a reply to message #1723250] Tue, 16 February 2016 18:31 Go to previous messageGo to next message
Eclipse UserFriend
Can you access the zip file normally from the file system? There appears to be content?
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723613 is a reply to message #1723612] Tue, 16 February 2016 18:39 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Thanks for replying.

You'll note from one of my addendums that I also tried using the "Local" choice instead of "Archive", which bypasses the zip file, with the same result. The error also does not say WHICH zip file can't be read. Note that jar files are also zip files.
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723615 is a reply to message #1723613] Tue, 16 February 2016 18:58 Go to previous messageGo to next message
Eclipse UserFriend
Debugging via forum is pretty hard.

Have you tried checking all the jar and zip files in the generated archive? Running the unzip tool on all the items is pretty easy.

Have you checked your build log to make sure there wasn't some warning or error message thrown during the build?

Or you could attach a remote debugger and put a breakpoint on java.util.zip.ZipException and examine the stack in situ.

Brian.
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723620 is a reply to message #1723615] Tue, 16 February 2016 20:00 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Thanks in advance.

Brian de Alwis wrote on Tue, 16 February 2016 10:58
Debugging via forum is pretty hard.

You're telling me? Smile

Brian de Alwis wrote on Tue, 16 February 2016 10:58

Have you tried checking all the jar and zip files in the generated archive? Running the unzip tool on all the items is pretty easy.

I had previously checked the contents lazily by piping "find" into "xargs jar tvf", but just now I explicitly did "tar tvf" on every jar file in the tree. No obvious issues anywhere.

Brian de Alwis wrote on Tue, 16 February 2016 10:58

Have you checked your build log to make sure there wasn't some warning or error message thrown during the build?

Just checked again. The entire build completes successfully, or I wouldn't be talking about this issue, but I just rebuilt it again and looked for anything suspicious in the entire log, and I didn't see anything.

Brian de Alwis wrote on Tue, 16 February 2016 10:58

Or you could attach a remote debugger and put a breakpoint on java.util.zip.ZipException and examine the stack in situ.

Brian.

I've been doing this previously in a test instance launched from this target instance, but I guess I can add those params to a normal instance and point my usual remote debugger instance to that.

On my first attempt, I must be doing something wrong. I formed a command line to execute eclipse with the added parameters as directed. I used "ps" to verify those args were on the command line. I then connected from the debugger instance. It refused the connection. I then ran "netstat -a | grep 5005" on the target box, and it doesn't show the port.

I know the connection from my debugger instance to the box with the instance works, because I normally launch a test instance from that target instance and connect remotely from my debugger instance. That's still working fine.

Just so it's clear, my "debugger" instance is on my host, and my current desired target instance is on a VM running on the host. I've been previously launching a test instance from that target instance and connecting my remote debugger (on the host) to that test instance, and that works fine. I even just tried changing the port number (in both target and debugger) to match the port number I've been using to connect to the test instance, but it still says "Connection Refused" (I verified that "ps" shows the new port number in the command line).
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723762 is a reply to message #1723620] Wed, 17 February 2016 17:26 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Ok, attaching the debugger made a big difference. I think I now have enough information to "fix" my particular problem, although I'll need to know the details of exactly what I need to remove (you'll see what I mean). However, I want to go a little further than this and submit an enhancement request to add more info to the exception. No regular Eclipse user should have had to do what I did just to figure out what zip file was corrupted. Someone on my SO posting mentioned some properties that might provide more debugging output, which I'll also look at.

When it hit the breakpoint, it referred to "<myhome>/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar". I looked at this file, and it wasn't zero length, but when I ran "jar tvf" on it, it said this:
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:120)
	at sun.tools.jar.Main.list(Main.java:1115)
	at sun.tools.jar.Main.run(Main.java:293)
	at sun.tools.jar.Main.main(Main.java:1288)


I then also ran "unzip -tq" on the file, which seemed to provide more information, whether I could use it or not:
[<myhome>/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of <myhome>/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar or
        <myhome>/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar.zip, and cannot find <myhome>/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar.ZIP, period.


I then piped every jar in $HOME/.p2 into "unzip -tq", and it found 5 jars, all in the "org.eclipse.emf" package, reporting this same error.

At this point, I tried looking further up the callstack, to "org.eclipse.osgi.internal.signedcontent.SignedBundleHook". I searched the zip files for this class, and found that the block in question looks like this:
} else {
  // make sure we have a ZipFile first, this will throw an IOException if not valid
  ZipFile temp = new ZipFile(content);
  temp.close();
  contentBundleFile = new ZipBundleFile(content,null,null,container.getConfiguration().getDebug());
}

The comment here is ironic. Would it be reasonable for this code to properly catch the exception so that the full path to the zip file in question is reported? Is there some particular information I should add in an enhancement request for this?

Once I've gotten all the diagnostics I want in order to report this properly, what exactly do I have to do to fix this for my distro? Is it enough to just delete the corrupted jars? Will Eclipse redownload those? Do I have to shut down Eclipse before I do that?
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723768 is a reply to message #1723762] Wed, 17 February 2016 18:38 Go to previous messageGo to next message
Eclipse UserFriend
Typically invalid zip/jar files are signs of running out of disk space. FWIW, all of my ~/.p2/.pool/plugins/org.eclipse.emf* bundles are fine.

I can only suggest moving the offending jars aside (so you can 'recover' them, even if they're broken) and see what happens.

You can try fixing the code, which I'm guessing is in p2. If you have EGit installed, you should be able to use the Plug-ins view and select File Import > Plug-ins and Fragments and import them as 'projects from a repository'.

Brian.

Re: Get error in "CheckTrust" phase will installing from local update site [message #1723769 is a reply to message #1723768] Wed, 17 February 2016 19:00 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
I did have a disk space crisis a couple of weeks ago, which required me doing some virtualbox/fdisk surgery to get more space. I guess this was one of the results.

Ok, I'll try shutting down Eclipse, moving those corrupted jars, restarting Eclipse, and trying to install the plugin. Hopefully some part of that process will restore those jars.

I'm not sure what you mean by "You can try fixing the code". Can you be more specific?
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723771 is a reply to message #1723769] Wed, 17 February 2016 19:17 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
I brought down Eclipse. I carefully logged the paths to the corrupted jar files, and moved them to another location. I then restarted Eclipse and attempted the plugin install again. Now I get the following error:
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.
$HOME/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar (No such file or directory)

Ironically, now it gives me the full path to the (missing) jar file.

So, how do I patch a corrupted p2 repo? Am I just going to have to find those specific jar files somewhere? Where would I find them?
Re: Get error in "CheckTrust" phase will installing from local update site [message #1723978 is a reply to message #1723771] Fri, 19 February 2016 11:54 Go to previous message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 333
Registered: July 2009
Location: Ottawa
Senior Member
The Eclipse installer includes a tool to repair bundle pools. You can get the installer from https://eclipse.org/downloads/

When you start the installer, select the icon in the upper right corner, and select "bundle pools", select the desired bundle pool, hit the "analyze" button. In the new window, select the artifacts to enable the "Repair" button below the main list.

HTH
Previous Topic:Unable to locate companion library of stand-alone new product
Next Topic:Start eclipse with specific size or maximum size
Goto Forum:
  


Current Time: Thu Apr 25 05:26:03 GMT 2024

Powered by FUDForum. Page generated in 0.04415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top