Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 236762 - May not retry on failed download of pack200
Summary: May not retry on failed download of pack200
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.5   Edit
Assignee: Matthew Piggott CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 227633 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-11 19:05 EDT by Nick Boldt CLA
Modified: 2009-04-09 13:41 EDT (History)
5 users (show)

See Also:


Attachments
screenshot of selected SDKs to install (85.89 KB, image/png)
2008-06-11 19:05 EDT, Nick Boldt CLA
no flags Details
console log (17.64 KB, text/plain)
2008-06-11 19:05 EDT, Nick Boldt CLA
no flags Details
UpdateSiteFactory patch (14.87 KB, patch)
2009-03-31 15:25 EDT, Matthew Piggott CLA
pascal: iplog+
Details | Diff
Data for testcase (1.71 KB, application/zip)
2009-03-31 15:30 EDT, Matthew Piggott CLA
pascal: iplog+
Details
Test for fail over from packed to canonical descriptors (10.83 KB, patch)
2009-03-31 16:59 EDT, Matthew Piggott CLA
pascal: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Boldt CLA 2008-06-11 19:05:24 EDT
Created attachment 104577 [details]
screenshot of selected SDKs to install

Usecase:

For testing an internal copy (emft.eclipse.org) of a public update site (download.eclipse.org) before publishing it.

Steps to reproduce:

1. fire up eclipse-SDK-3.4RC4-linux-gtk.tar.gz
2. add http://emft.eclipse.org/modeling/emf/updates/milestones/
3. search site and select CDO and Net4j RC4a builds' SDK features.
4. install
5. get attached log of errors

I checked the update site, and the jars and packed jars are there, no problem.

Now, granted, the site.xml contains this:

<site pack200="true" digestURL="http://download.eclipse.org/modeling/emf/updates/milestones/" mirrorsURL="http://www.eclipse.org/downloads/download.php?file=/modeling/emf/updates/milestones/site.xml&amp;format=xml">

but in the past, mirrorsURL was only a suggestion, not an enforced rule, and if the mirrors couldn't be found, the fallback was the local site. Is there a reason this behaviour has been changed?

--

So... if this isn't fixable / shouldn't be fixed in p2land, then one workaround from my end might be to suppress the digestURL and mirrorsURL when the site is only a local copy (ie., when buildUpdateSite.sh isn't handed the -promote flag).
Comment 1 Nick Boldt CLA 2008-06-11 19:05:51 EDT
Created attachment 104578 [details]
console log
Comment 2 Nick Boldt CLA 2008-06-11 20:17:09 EDT
Verified. Installing from the build server's test update site w/o digestURL and mirrorsURL works great.

Just in case there isn't time to fix this for 3.4.0, I've implement the workaround in buildUpdateSite.sh so that we only have the following.

  <site pack200="true">

Still, it would be ideal if p2 could look at the local site before claiming it can't find the jars on any of the mirrors. 
Comment 3 Pascal Rapicault CLA 2008-06-11 22:02:04 EDT
>but in the past, mirrorsURL was only a suggestion, not an enforced rule, and if the mirrors couldn't be found, the fallback was the local site. Is there a reason this behaviour has been changed?
  The fallback case has not been changed. The logic that is supposed to be implemented is: look for pack.gz if available and applicable, if the pack.gz can't be found (e.g. error while downloading) then default back to the "canonical" artifact (e.g. the regular jar).
  If you have an easily reproducible test case (or if I can remotely debug on the machine where the problem occurs) I would be interested.
  Were you installing from a p2 repo or from an UM site?
  
This problem seems to be one of download. The control of the repository question is being handled in bug 235491.
Comment 4 Pascal Rapicault CLA 2008-06-11 22:28:42 EDT
Nick which version of the director are you using?
Comment 5 Nick Boldt CLA 2008-06-11 23:11:15 EDT
(In reply to comment #4)
> Nick which version of the director are you using?

Not sure what you mean by director. For creating the p2 metadata, I use releng.basebuilder from tag RC2_34, the latest released version. For trying to install from that update site, I used Eclipse 3.4RC4.

(In reply to comment #3)
>   The fallback case has not been changed. The logic that is supposed to be
> implemented is: look for pack.gz if available and applicable, if the pack.gz
> can't be found (e.g. error while downloading) then default back to the
> "canonical" artifact (e.g. the regular jar).

Ah, but if you're searching for both of these on a mirror that doesn't contain them, do you fall back to the actual URL?

That is, if you hit http://emft.eclipse.org/modeling/emf/updates/milestones/, and find that http://emft.eclipse.org/modeling/emf/updates/milestones/site.xml says:

mirrorsURL="http://www.eclipse.org/downloads/download.php?file=/modeling/emf/updates/milestones/site.xml&format=xml"

and you resolve that URL but don't find the requested update (Net4j 1.0.0RC4a, for example)...

... will you then simply check http://emft.eclipse.org/modeling/emf/updates/milestones/ for the jars and jar.pack.gzs (which are in fact present)?

The only place any of the metadata files (digest.zip, artifacts.jar, content.jar) reference download.eclipse.org is in content.xml, extracted from content.jar:

 <references size='4'>
    <repository url='http://download.eclipse.org/modeling/emft/updates/' type='0' options='0'/>
    <repository url='http://download.eclipse.org/modeling/emf/updates/' type='0' options='1'/>
    <repository url='http://download.eclipse.org/modeling/emf/updates/' type='1' options='1'/>
    <repository url='http://download.eclipse.org/modeling/emft/updates/' type='1' options='0'/>
  </references>

Would it help if the actual site (http://emft.eclipse.org/...) was listed there too?

>   If you have an easily reproducible test case (or if I can remotely debug on
> the machine where the problem occurs) I would be interested.

Yes, the one I documented is easily reproducible. See comment 0.

>   Were you installing from a p2 repo or from an UM site?

A p2-enabled UM site, of course -- we long ago put to bed the issue of updates sites needing p2 metadata (except that one about Europa being enhanced w/ p2 metadata). You can browse the directory here, where you'll find digest.zip, artifacts.jar, and content.jar:

http://emft.eclipse.org/modeling/emf/updates/milestones/
 
If you'd like ssh access, I can give you that too. Hell, you can reproduce the entire update site (or at least a single Net4j update) using my script on your local machine, simply by pointing it at a mirror of this directory:

http://emft.eclipse.org/modeling/emf/net4j/downloads/drops/1.0.0/S200806111344/

I can walk you thru the setup if you'd like -- you just need rsync to grab the directory then to fire a shell script to extract the jars, generate the site.xml, & create the digest & p2 metadata. 

Comment 6 Pascal Rapicault CLA 2009-03-30 22:08:57 EDT
Could you please write a test to ensure that we worried mentioned in the title is not happening. Thx.
Comment 7 Matthew Piggott CLA 2009-03-31 15:25:08 EDT
Created attachment 130450 [details]
UpdateSiteFactory patch

The patch fixes pack200 support for UpdateSites and enables mirrors.  The test case also requires a few additional files to follow
Comment 8 Matthew Piggott CLA 2009-03-31 15:30:53 EDT
Created attachment 130451 [details]
Data for testcase

I modified an existing update site repository to enable pack200 and mirrors, the zip simply contains pack.gz versions of the plugin/feature files found in:
/org.eclipse.equinox.p2.tests/testData/updatesite/site
Comment 9 Matthew Piggott CLA 2009-03-31 16:59:48 EDT
Created attachment 130467 [details]
Test for fail over from packed to canonical descriptors
Comment 10 Pascal Rapicault CLA 2009-04-09 13:36:01 EDT
*** Bug 227633 has been marked as a duplicate of this bug. ***
Comment 11 Pascal Rapicault CLA 2009-04-09 13:40:34 EDT
This has been fixed in HEAD. We will be adding a few more tests.