Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314603 - invalid content in packed platform bundles
Summary: invalid content in packed platform bundles
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Releng (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.6 RC4   Edit
Assignee: Kim Moir CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-27 01:14 EDT by David Williams CLA
Modified: 2010-06-03 14:13 EDT (History)
5 users (show)

See Also:
kim.moir: documentation+
darin.eclipse: review+
Olivier_Thomann: review+


Attachments
patch (783 bytes, patch)
2010-05-31 15:25 EDT, Kim Moir CLA
no flags Details | Diff
patch (784 bytes, patch)
2010-05-31 15:26 EDT, Kim Moir CLA
no flags Details | Diff
patch (698 bytes, patch)
2010-06-01 09:19 EDT, Kim Moir CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2010-05-27 01:14:53 EDT
While doing an "experimental build" where the platform files are "validated" the same way as other projects ... that is, where the b3.aggregator copies pack.gz files, and expands them to jars. I received the following error message in build logs. See  

https://build.eclipse.org/hudson/job/helios.runHybrid/1/console
 
There is no mail sent out (turned it off, since experimental) but thought you'd want to know about it. I know this happened before, and some "verification" was put in place? So, thought you might like to know. 

This would be from "RC2" content. 



 [exec] Mirroring meta-data from from http://download.eclipse.org/eclipse/updates/3.6milestones
[exec] Mirroring artifacts from from http://download.eclipse.org/eclipse/updates/3.6milestones 

 [exec] - mirroring artifact osgi.bundle,org.eclipse.pde.api.tools,1.0.201.v20100520 [exec] doing copy of optimized artifact [exec] unpacking optimized artifact
[exec] Unable to unpack artifact osgi.bundle,org.eclipse.pde.api.tools,1.0.201.v20100520 in repository file:/shared/helios/hybrid/final/aggregate: Invalid content:org/eclipse/pde/api/tools/internal/provisional/Factory.class 

     [exec] Unable to unpack artifact osgi.bundle,org.eclipse.jdt.debug.ui,3.5.0.v20100519 in repository file:/shared/helios/hybrid/final/aggregate: Invalid content:org/eclipse/jdt/internal/debug/ui/jres/JREsEnvironmentLabelProvider.class


(There might be others ... I'm finishing bug before its done ... search for "Unable to unpack" in "runHybrid" log linked above.
Comment 1 Kim Moir CLA 2010-05-27 07:53:54 EDT
Hi David

Yes, I noticed these errors in our comparator logs earlier this week and asked the team to retag these bundles so the packed files are regenerated.  So this should be fixed for RC3.
Comment 2 David Williams CLA 2010-05-31 03:17:08 EDT
Seems still there, with RC3 delivery. At least jdt one. 

https://build.eclipse.org/hudson/job/helios.runHybrid/2/console
Comment 3 David Williams CLA 2010-05-31 03:20:16 EDT
api tools too

    [exec] Unable to unpack artifact osgi.bundle,org.eclipse.pde.api.tools,1.0.201.v20100526-1600 in repository file:/shared/helios/hybrid/final/aggregate: Invalid content:org/eclipse/pde/api/tools/internal/provisional/Factory.class


seems to be different tags. Maybe you have a few that can not be packed?
Comment 4 Kim Moir CLA 2010-05-31 08:36:23 EDT
Yes, we just retagged them but this didn't fix the problem.  Looking at them in further detail, it looks like pde.api.tools and jdt.debug.ui bundles have nested jars. Andrew, should I add an eclipse.inf to exclude the nested jars from the jar processor?  I recall that this was a problem with other bundles.
Comment 5 Kim Moir CLA 2010-05-31 08:37:07 EDT
Sorry, previous comment should have read "Ask the teams that own the bundles to add eclipse.inf files to exclude nested jars from jar processor" :-)
Comment 6 David Williams CLA 2010-05-31 13:51:13 EDT
Can you repair the current repo(s)? Having these pack.gz files fail causes downstream tasks to fail. See bug 312656. I would mark this bug as "blocking" except that bug 312656 is not an officially committed deliverable.
Comment 7 Kim Moir CLA 2010-05-31 14:19:32 EDT
Yes, I'll remove them using the remove.iu task.
Comment 8 Andrew Niefer CLA 2010-05-31 15:02:52 EDT
Adding 
jarprocessor.exclude.children.pack=true
to the bundle's META-INF/eclipse.inf file does seem to make this problem go away (at least in my experiments with org.eclipse.pde.api.tools).

I don't have any particular explanation for what the problem is, especially since the mentioned classes aren't in the nested jar, but are in the outer jar.
Comment 9 Kim Moir CLA 2010-05-31 15:24:12 EDT
Since we don't know what is causing the failure in packing the jars, the best solution is probably to remove these two packed artifacts from the repository.  I'll attach a patch to do that and ask for approval.
Comment 10 Kim Moir CLA 2010-05-31 15:25:06 EDT
Created attachment 170583 [details]
patch
Comment 11 Kim Moir CLA 2010-05-31 15:26:29 EDT
Created attachment 170584 [details]
patch
Comment 12 Kim Moir CLA 2010-05-31 15:43:19 EDT
Olivier, Darin this patch is to remove the packed org.eclipse.jdt.debug.ui and
org.eclipse.pde.api.tools bundles from the repository. The non-packed jars will remain. The problem is that we don't know what is causing the packed jars to be corrupt so the safest approach is to remove them.  The non-packed jars will be used instead when people update from the repository. Please approach the patch I have attached for RC4.  We use the same approach for other bundles in the repository.
Comment 13 Kim Moir CLA 2010-05-31 16:28:34 EDT
I've fixed the RC3 repository to remove the problem packed bundles.  This change is now replicating to eclipse.org. The attached patch is to remove them in future builds.
Comment 14 Darin Wright CLA 2010-05-31 16:47:30 EDT
I agree that we should remove the invalid content.
Comment 15 David Williams CLA 2010-05-31 20:45:30 EDT
Wouldn't it be better to mark these as "do not pack", via the eclipse.inf file? 

jarprocessor.exclude.pack

That way, they'd be more "self documenting" and be less sensitive to exact steps of your build process (e.g. in theory, others might accidentally pack200 them ... though no of no specific cases where that could happen).
Comment 16 Kim Moir CLA 2010-06-01 09:19:38 EDT
Created attachment 170631 [details]
patch

Yes, David's right.  Adding the jarprocessor.exclude.pack=true in the eclipse.inf of the bundles is a better solution. Here's a new patch. Darin, since you have commit rights on these bundles, could you release this patch once we have approvals?
Comment 17 Olivier Thomann CLA 2010-06-01 16:56:19 EDT
Looks good. Will release and tag for next build.
Comment 18 Olivier Thomann CLA 2010-06-01 16:58:21 EDT
Kim,

.inf files don't have copyright statements ?
Comment 19 Darin Wright CLA 2010-06-01 17:01:01 EDT
I released the change to jdt.debug.ui.
Comment 20 Olivier Thomann CLA 2010-06-01 18:16:44 EDT
I released the patch for api tooling.
I'll update the copyright statement later if required.
Comment 21 Kim Moir CLA 2010-06-01 22:28:24 EDT
Thanks Olivier!
Comment 22 Kim Moir CLA 2010-06-02 09:17:59 EDT
This revealed a bug in the jar processor where the nested jars in these bundles were created in pack.gz form. I've opened bug 315392 against p2 for this issue.  Olivier and Darin, please remove the eclipse.inf files from the jdt.debug.ui and pde.api.tools bundles and retag.  I'm sorry for this, I've never seen this bug before. I'll use the other patch to remove the IUs manually from the repository.
Comment 23 Olivier Thomann CLA 2010-06-02 09:26:43 EDT
Done for api tooling.
Note that since debug.ui has no nested jars, I don't think this is a problem in this case.
Comment 24 Darin Wright CLA 2010-06-02 09:28:48 EDT
Done for jdt.debug.ui
Comment 25 Andrew Niefer CLA 2010-06-02 10:40:33 EDT
Sorry, I should have looked at the patches, 
jarprocessor.exclude.children.pack
is the property you want in the outer bundle's eclipse.inf file.

I can imagine how the jarprocessor.exclude.pack will still allow the child jars to get packed, but the outer jar would not be packed which of course leads to problems where the inner jar will never get unpacked for install
Comment 26 Kim Moir CLA 2010-06-02 10:43:13 EDT
As a side note, the director failed during the integration build with this error

[p2.director] Installing org.eclipse.sdk.ide 3.6.0.I20100602-0800.
[p2.director] Installing org.eclipse.equinox.p2.ui.admin.rcp.product 1.1.0.I20100602-0800.
[p2.director] Installing org.eclipse.platform.sdk 3.6.0.I20100602-0800.
[p2.director] Installing org.eclipse.platform.ide 3.6.0.I20100602-0800.
[p2.director] Installation failed.
[p2.director] An error occurred while collecting items to be installed
[p2.director]  session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
[p2.director]  Problems downloading artifact: osgi.bundle,org.eclipse.jdt.debug.ui,3.5.0.v20100601-1600.
[p2.director]   File has invalid content:/tmp/signatureFile3355781499911901948.jar
[p2.director]    Invalid content:snippetsupport.jar
[p2.director] Caused by:    org.eclipse.osgi.signedcontent.InvalidContentException: A file "snippetsupport.jar" has been removed from the jar: /tmp/signatureFile3355781499911901948.jar
[p2.director] Caused by:    java.lang.SecurityException: A file "snippetsupport.jar" has been removed from the jar: /tmp/signatureFile3355781499911901948.jar
[p2.director]  Problems downloading artifact: osgi.bundle,org.eclipse.pde.api.tools,1.0.201.v20100601-1815.
[p2.director]   File has invalid content:/tmp/signatureFile1221726431274335440.jar
[p2.director]    Invalid content:lib/apitooling-ant.jar
[p2.director] Caused by:    org.eclipse.osgi.signedcontent.InvalidContentException: A file "lib/apitooling-ant.jar" has been removed from the jar: /tmp/signatureFile1221726431274335440.jar
[p2.director] Caused by:    java.lang.SecurityException: A file "lib/apitooling-ant.jar" has been removed from the jar: /tmp/signatureFile1221726431274335440.jar
[p2.director] Operation completed in 7556 ms.

It's strange that it didn't fail during the nightly build this way.
Comment 27 Kim Moir CLA 2010-06-03 14:13:13 EDT
This is fixed in I20100602-1502.

I've opened bug 315640 to fix the eclipse.infs in the bundles next release so we don't have to rely on the build process to remove the corrupt jars.