Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347538 - Target installer reports MD5 mismatch
Summary: Target installer reports MD5 mismatch
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: Releng (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 330297
Blocks:
  Show dependency tree
 
Reported: 2011-05-28 05:49 EDT by Ralf Sternberg CLA
Modified: 2011-09-30 09:18 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2011-05-28 05:49:45 EDT
When trying to install the latest stable build (should be 1.4RC2) using the RAP tooling, I got the following error:

Problems occurred while resolving the target contents
An error occurred while collecting items to be installed
session context was:(profile=TARGET_DEFINITION:local:1306575008707.target, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Problems downloading artifact: osgi.bundle,org.eclipse.equinox.http.registry,1.1.100.v20110502.
MD5 hash is not as expected. Expected: 03d541989acab427b324990d9d551e67 and found 19ecfce1cac5eea477d404688083fef8.
Comment 1 Beyhan Veliev CLA 2011-05-28 07:19:22 EDT
It seems that the bundle "org.eclipse.equinox.http.registry" is corrupted in our target repository. Did we changed something in this bundle?
Comment 2 Ralf Sternberg CLA 2011-05-28 11:56:33 EDT
I checked the repository and found that the md5 hash of the bundle is in fact 19...f8. The artifacts.jar also contains this hash. This means that the repository is not broken, but p2 expects a different hash.

rsternber@dev2:~/download/1.4/runtime/RC2/plugins> md5sum org.eclipse.equinox.http.registry_1.1.100.v20110502.jar
19ecfce1cac5eea477d404688083fef8  org.eclipse.equinox.http.registry_1.1.100.v20110502.jar

rsternber@dev2:~/download/1.4/runtime/RC2> zless artifacts.jar
   ...
    <artifact classifier='osgi.bundle' id='org.eclipse.equinox.http.registry' version='1.1.100.v20110502'>
      <properties size='3'>
        <property name='artifact.size' value='43998'/>
        <property name='download.size' value='43998'/>
        <property name='download.md5' value='19ecfce1cac5eea477d404688083fef8'/>
      </properties>
    </artifact>
   ...
Comment 3 Ralf Sternberg CLA 2011-05-29 07:10:04 EDT
I found the expected checksum in the artifacts.jar of the RC1 runtime.
    ...
    <artifact classifier='osgi.bundle' id='org.eclipse.equinox.http.registry' version='1.1.100.v20110502'>
      <properties size='3'>
        <property name='artifact.size' value='43998'/>
        <property name='download.size' value='43998'/>
        <property name='download.md5' value='03d541989acab427b324990d9d551e67'/>
      </properties>
    </artifact>
    ...

So the problem seems to be related to the fact that we re-sign bundles that have not changed. Signing always leads to a new checksum. The bundles from the base platform have yet another checksum, but it does not change:

rsternber@build:/shared/rt/rap/base-platforms/eclipse-3.7RC1/plugins> md5sum org.eclipse.equinox.http.registry_1.1.100.v20110502.jar 
d46acfe18868e4928e0c09a2c2f4eedc  org.eclipse.equinox.http.registry_1.1.100.v20110502.jar
rsternber@build:/shared/rt/rap/base-platforms/eclipse-3.7RC2/plugins> md5sum org.eclipse.equinox.http.registry_1.1.100.v20110502.jar 
d46acfe18868e4928e0c09a2c2f4eedc  org.eclipse.equinox.http.registry_1.1.100.v20110502.jar
Comment 4 Beyhan Veliev CLA 2011-06-02 05:18:50 EDT
(In reply to comment #3)

I analyzed the p2 logic to check the MD5 checksum of a bundle in 3.6 SR2 and 3.7 RC2. The problem described in this bug can happen when the artifact (org.eclipse.equinox.http.registry) has been downloaded from http://download.eclipse.org/rt/rap/1.4/runtime/RC2 and the metadata of repository http://download.eclipse.org/rt/rap/1.4/runtime/RC1 has been used to verify the md5 checksum. This problem can't happen in 3.6 SR2 and 3.7 RC2 because the metadata of the repository from where the bundle has been downloaded is used to verify the MD5 checksum. I also couldn't success to reproduce it with tests and didn't find any p2 bugs for this.
Comment 5 Ralf Sternberg CLA 2011-09-30 09:18:47 EDT
In RAP 1.4, our build re-compiled bundles from the platform in the pack200 stage. This could lead to different artifacts with same id and version. These duplicates must have provoked this checksum error.

This cannot happen with RAP 1.5 anymore, since the new runtime build now only compiles bundles produced by RAP. Platform bundles for the target requirements feature are only copied from the platform repository.