# SlicerOpenCV MD5 hash mismatch

**URL:** https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051
**Category:** Development
**Tags:** build, extensions-manager
**Created:** [September 14, 2017, 9:07pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051 "2017-09-14T21:07:32Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![tdiprima](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tdiprima/32/9469_2.png) [@tdiprima](https://discourse.slicer.org/u/tdiprima)
#### Post date: [September 14, 2017, 9:07pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/1 "2017-09-14T21:07:32Z")

</div>

Hello Folks 🙂

I’m building SlicerOpenCV. And I’m getting an error that says that the MD5 hash of SlicerOpenCV-build/OpenCV-prefix/src/3.1.0.tar.gz does not match expected value.

```
expected: '70e1dd07f0aa06606f1bc0e3fa15abd3'
  actual: 'a0669e22172dfc3225835b180744c9f0'

```

So it can’t download OpenCV.

And I think this is why my nightly build is failing. I’m not sure what to do… should I be contacting the OpenCV folks?

Thanks!

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 15, 2017, 12:38am UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/2 "2017-09-15T00:38:44Z")

</div>

Most probably it was a interrupted or corrupted download. Deleting the corrupted file should fix the problem.

---

<div class="post-metadata">

### Author: ![tdiprima](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tdiprima/32/9469_2.png) [@tdiprima](https://discourse.slicer.org/u/tdiprima)
#### Post date: [September 15, 2017, 1:26pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/3 "2017-09-15T13:26:36Z")

</div>

Andras, I did that twice yesterday. Tried again today, and still no luck.  
Checked Google. Seems to be a recurring issue. Thanks for your response.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 15, 2017, 3:08pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/4 "2017-09-15T15:08:48Z")

</div>

What’s in your .tar.gz file? Is it a truncated version of the file that you can download from [https://github.com/Itseez/opencv/archive/3.1.0.tar.gz](https://github.com/Itseez/opencv/archive/3.1.0.tar.gz)? Or does it contain an error message (maybe your firewall blocks it…)?

---

<div class="post-metadata">

### Author: ![tdiprima](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tdiprima/32/9469_2.png) [@tdiprima](https://discourse.slicer.org/u/tdiprima)
#### Post date: [September 15, 2017, 3:11pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/5 "2017-09-15T15:11:40Z")

</div>

Hi guys,

SlicerPathology depends on SlicerOpenCV… I hope you can help me out.

Here’s [the build error](http://slicer.cdash.org/viewBuildError.php?buildid=1097176).

And it says:

```auto
-- MD5 hash of
    /.../SlicerOpenCV-build/OpenCV-prefix/src/3.1.0.tar.gz
  does not match expected value
    expected: '70e1dd07f0aa06606f1bc0e3fa15abd3'
      actual: 'a0669e22172dfc3225835b180744c9f0'

 Each download failed!

```

Google search indicates a recurring issue that could possibly be resolved with a different CMake version.

Can you guys please help?

Thanks!

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 15, 2017, 3:16pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/6 "2017-09-15T15:16:59Z")

</div>

I’ve downloaded the file manually from [https://github.com/Itseez/opencv/archive/3.1.0.tar.gz](https://github.com/Itseez/opencv/archive/3.1.0.tar.gz) and the file’s MD5 sum is in fact ‘a0669e22172dfc3225835b180744c9f0’. So, it seems that the package has actually changed. It is not likely that the change is malicious or introduces errors, but it’s quite unusual that a release package is changed many months after it was released.

@tidiprima Could you check if you can find another trustworthy source for OpenCV 3.1.0 source code and compare them to make sure the package we use ([https://github.com/Itseez/opencv/archive/3.1.0.tar.gz](https://github.com/Itseez/opencv/archive/3.1.0.tar.gz)) is valid?

---

<div class="post-metadata">

### Author: ![tdiprima](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tdiprima/32/9469_2.png) [@tdiprima](https://discourse.slicer.org/u/tdiprima)
#### Post date: [September 15, 2017, 3:21pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/7 "2017-09-15T15:21:54Z")

</div>

Nope. The problem is in SlicerOpenCV code. Hard-coded MD5. [https://github.com/SBU-BMI/SlicerOpenCV/blob/master/SuperBuild/External\_OpenCV.cmake#L33](https://github.com/SBU-BMI/SlicerOpenCV/blob/master/SuperBuild/External_OpenCV.cmake#L33)

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 15, 2017, 3:49pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/8 "2017-09-15T15:49:24Z")

</div>

The value is supposed to be hardcoded (a release package is never supposed to be changed. I would suggest to have a look what is the new content, but ultimately it’s up to the maintainers of that extension to decide if they accept the new version as is or want to do some digging. I saw that you’ve already submitted an issue ([https://github.com/SBU-BMI/SlicerOpenCV/issues/41](https://github.com/SBU-BMI/SlicerOpenCV/issues/41)), so that should be enough - maintainers will make the necessary fix soon.

---

<div class="post-metadata">

### Author: ![thewtex](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thewtex/32/32_2.png) [@thewtex](https://discourse.slicer.org/u/thewtex)
#### Post date: [September 17, 2017, 7:23pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/9 "2017-09-17T19:23:41Z")

</div>

In conversations with Francois Budin the other day, he noted that the hashes on files hosted on GitHub had the property of not being consistent.

Hosting the data on Midas or Girder may address the issue.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [September 17, 2017, 8:19pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/10 "2017-09-17T20:19:05Z")

</div>

md5 hash may only differ if the file content is changed. It would be really odd if GitHub would arbitrarily change release files.

Line endings of text files may be translated differently depending on git settings, so maybe that is what you are referring to?

---

<div class="post-metadata">

### Author: ![thewtex](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thewtex/32/32_2.png) [@thewtex](https://discourse.slicer.org/u/thewtex)
#### Post date: [September 18, 2017, 5:35pm UTC](https://discourse.slicer.org/t/sliceropencv-md5-hash-mismatch/1051/11 "2017-09-18T17:35:50Z")

</div>

No, this was for release files instead of Git repository files, which have natural hash checks due to the way Git works.
