Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to repair corrupted files in the $HOME/.p2 repo?
How to repair corrupted files in the $HOME/.p2 repo? [message #1723905] Fri, 19 February 2016 04:09 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 530
Registered: July 2009
Senior Member
For quite a while now, I've been struggling with the side effects of running out of disk space on my Ubuntu VM a couple of weeks ago now. I enlarged the virtual disk relatively quickly, but apparently something I was doing with Eclipse at the time managed to corrupt five jar files in my $HOME/.p2 tree. That's the theory, at least.

Along the way, I battled an Eclipse exception message about a corrupted zip file that was telling me nothing about what zip file was corrupted (which I filed a bug for, which someone happily fixed, in the source at least, in less than an hour after I filed it). It took me embarrassingly much longer than it should have for me to realize I could point a debugger at the target instance to figure out what archive was corrupted.

I determined that there were actually five corrupted jar files, all in my "$HOME/.p2" tree, and these are them:
$HOME/.p2/pool/plugins/org.eclipse.emf.mapping.ecore2ecore.editor_2.7.0.v20160201-0859.jar
$HOME/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar
$HOME/.p2/pool/plugins/org.eclipse.emf.mapping.ecore2xml_2.9.0.v20160201-0859.jar
$HOME/.p2/pool/plugins/org.eclipse.emf.mapping.ecore2xml.ui_2.8.0.v20160201-0859.jar
$HOME/.p2/pool/plugins/org.eclipse.emf.mapping.ui_2.7.0.v20160201-0859.jar


None of these files are zero length, they're just corrupted, as both "jar tvf" and "unzip -tq" tell me.

At this point, I thought I was in the home stretch, because this "$HOME/.p2" thing felt like the "$HOME/.m2/repository" tree, where you can just remove corrupted files and the next Maven build will regenerate them. Unfortunately, this is not the case. Removing any of them just changed the exception message (ironically, now giving me the full path to the jar file that doesn't exist).

So how do I repair this with minimal effort?
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723906 is a reply to message #1723905] Fri, 19 February 2016 04:15 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 672
Registered: January 2012
Senior Member

There is an Ant task 'p2.remove.iu' to remove an IU from a repo; I wonder if that would be sufficient. I put together a set of wrapper scripts for *nix shells with a p2-remove-ius command that might be helpful.

Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723907 is a reply to message #1723906] Fri, 19 February 2016 04:21 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 530
Registered: July 2009
Senior Member
Can you elaborate? I'm vaguely familiar with what an IU is, but I have no idea what removing an IU from a repo would do. Can you describe a series of steps using these scripts that would result in a repaired p2 repo?
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723912 is a reply to message #1723905] Fri, 19 February 2016 04:48 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6325
Registered: July 2009
Senior Member
Hi David,

With the Eclipse Installer (in advanced mode on the first page; in simple mode via the "Bundle Pools..." menu item) you
can open the Bundle Pool Analysis tool. There you can wait for the damage detection to finish and then either attempt to
repair or delete damaged artifacts. I've attached a screenshot for you. It's kind of an advanced function, so please
make a backup copy of your entire pool before you try to modify it. And please let me know how the procedure worked for
you. Good luck ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 19.02.2016 um 05:09 schrieb David M. Karr:
> For quite a while now, I've been struggling with the side effects of running out of disk space on my Ubuntu VM a
> couple of weeks ago now. I enlarged the virtual disk relatively quickly, but apparently something I was doing with
> Eclipse at the time managed to corrupt five jar files in my $HOME/.p2 tree. That's the theory, at least.
>
> Along the way, I battled an Eclipse exception message about a corrupted zip file that was telling me nothing about
> what zip file was corrupted (which I filed a bug for, which someone happily fixed, in the source at least, in less
> than an hour after I filed it). It took me embarrassingly much longer than it should have for me to realize I could
> point a debugger at the target instance to figure out what archive was corrupted.
>
> I determined that there were actually five corrupted jar files, all in my "$HOME/.p2" tree, and these are them:
> $HOME/.p2/pool/plugins/org.eclipse.emf.mapping.ecore2ecore.editor_2.7.0.v20160201-0859.jar
> $HOME/.p2/pool/plugins/org.eclipse.emf.mapping_2.9.0.v20160201-0859.jar
> $HOME/.p2/pool/plugins/org.eclipse.emf.mapping.ecore2xml_2.9.0.v20160201-0859.jar
> $HOME/.p2/pool/plugins/org.eclipse.emf.mapping.ecore2xml.ui_2.8.0.v20160201-0859.jar
> $HOME/.p2/pool/plugins/org.eclipse.emf.mapping.ui_2.7.0.v20160201-0859.jar
>
> None of these files are zero length, they're just corrupted, as both "jar tvf" and "unzip -tq" tell me.
>
> At this point, I thought I was in the home stretch, because this "$HOME/.p2" thing felt like the
> "$HOME/.m2/repository" tree, where you can just remove corrupted files and the next Maven build will regenerate them.
> Unfortunately, this is not the case. Removing any of them just changed the exception message (ironically, now giving
> me the full path to the jar file that doesn't exist).
>
> So how do I repair this with minimal effort?
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723913 is a reply to message #1723912] Fri, 19 February 2016 04:59 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 530
Registered: July 2009
Senior Member
Looks promising, but when I try to download the "Eclipse Installer" for my platform, which is Ubuntu Linux, it appears that it's just the regular archive format.
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723916 is a reply to message #1723913] Fri, 19 February 2016 05:05 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 530
Registered: July 2009
Senior Member
Never mind on that point, I noticed the executable inside the archive. Working on this now.
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723918 is a reply to message #1723913] Fri, 19 February 2016 05:06 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6325
Registered: July 2009
Senior Member
Am 19.02.2016 um 05:59 schrieb David M. Karr:
> Looks promising, but when I try to download the "Eclipse Installer" for my platform, which is Ubuntu Linux, it appears
> that it's just the regular archive format.
Yes. Please extract it to some location on your disk and run the "eclipse-inst" executable to start the Eclipse
Installer. If you have at least one startable Eclipse IDE on your machine, you can also open the Bundle Bool Analyzer
via Preferences -> Oomph -> Bundle Pools.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723919 is a reply to message #1723918] Fri, 19 February 2016 05:20 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 530
Registered: July 2009
Senior Member
Outstanding. It worked. It worked. Wow.

So since I have that Oomph section in the Eclipse instance that was having the problem (and since the $HOME/.p2 isn't specific to a single instance, it would be any on the same host), does that mean I didn't even need the one from the installer, I could have run the analyzer directly from the Oomph preferences?
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723920 is a reply to message #1723919] Fri, 19 February 2016 05:22 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 530
Registered: July 2009
Senior Member
And if you want SO credit Smile , you can submit the same answer on my SO posting: http://stackoverflow.com/questions/35488152/how-can-i-repair-a-damaged-eclipse-home-p2-repository , or I'll do it myself later, referring back to this thread.
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723921 is a reply to message #1723919] Fri, 19 February 2016 05:28 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6325
Registered: July 2009
Senior Member
Am 19.02.2016 um 06:20 schrieb David M. Karr:
> Outstanding. It worked. It worked. Wow.
Very good.

>
> So since I have that Oomph section in the Eclipse instance that was having the problem (and since the $HOME/.p2 isn't
> specific to a single instance, it would be any on the same host), does that mean I didn't even need the one from the
> installer, I could have run the analyzer directly from the Oomph preferences?
Yes ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: How to repair corrupted files in the $HOME/.p2 repo? [message #1723922 is a reply to message #1723920] Fri, 19 February 2016 05:29 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6325
Registered: July 2009
Senior Member
Am 19.02.2016 um 06:22 schrieb David M. Karr:
> And if you want SO credit :) , you can submit the same answer on my SO posting:
> http://stackoverflow.com/questions/35488152/how-can-i-repair-a-damaged-eclipse-home-p2-repository , or I'll do it
> myself later, referring back to this thread.
Hehe, please take the credit. I'm glad it worked for you.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:Can't get Eclipse to listen for debugger connections
Next Topic:Contributing a custom delete handler to the project explorer context menu
Goto Forum:
  


Current Time: Sat Nov 18 14:21:06 GMT 2017

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

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