fsaverage hash value mismatch

MNE Ver: 1.0.0
OS: WIndows 10

I was trying to follow the EEG forward operator with a template MRI — MNE 1.0.0 documentation tutorial, but got an error that the hash value of the download doesn’t match the expected hash value, which deleted the download. I think could manually download the fsaverage files, but the mismatched hash values got me worrying if it’s sage to do so.

My code is the same as the one in the tutorial:

import os.path as op
import numpy as np

import mne
from mne.datasets import eegbci
from mne.datasets import fetch_fsaverage

fs_dir = fetch_fsaverage(verbose = True)
subjects_dir = op.dirname(fs_dir)

subject = 'fsaverage'
trans = 'fsaverage'
src = op.join(fs_dir, 'bem', 'fsaverage-ico-5-src.fif')
bem = op.join(fs_dir, 'bem', 'fsaverage-5120-5120-5120-bem-sol.fif')

The error message I got was:

ValueError: MD5 hash of downloaded file (temp.zip) does not match the known hash: expected md5:5133fe92b7b8f03ae19219d5f46e4177 but got 0e8b7a0433464ef40b4482ff32be1a9d. Deleted download for safety. The downloaded file may have been corrupted or the known hash may be outdated.

hi @01450 ,

yes we have fixed this issue in the current main branch. We need to push a minor fix release on PyPi ideally today.

here the necessary fix in the code URL change due to OSF API change by agramfort · Pull Request #10489 · mne-tools/mne-python · GitHub

Alex

1 Like

Hi,
I’m facing a similar issue using the “sample” dataset. I’m currently running the main vesion and I checked mne\datasets\config.py file, and the corresponding url seems to be updated with the latest version available in OSF repository, as its hash code seems also correct. Nonetheless I keep getting an error of mismatching hashes. Do you know what could it be?

Code I’m running:

import os
from mne.datasets import sample
from mne.io import read_raw_fif

raw_fname = os.path.join(sample.data_path(), 'MEG', 'sample',
                         'sample_audvis_filt-0-40_raw.fif')
raw = read_raw_fif(raw_fname, preload=False, verbose=False)
sfreq = int(raw.info['sfreq'])  # 150 Hz

Error I got:

ValueError: MD5 hash of downloaded file (MNE-sample-data-processed.tar.gz) does not match the known hash: expected md5:e8f30c4516abdc12a0c08e6bae57409c but got a9dfc7e8843fd7f8a928901e12fb3d25. Deleted download for safety. The downloaded file may have been corrupted or the known hash may be outdated.

Hello @isacostamaia and welcome to the forum! Maybe the download got interrupted and now the file is corrupted? You can try to force-redownload the dataset:

import mne
mne.datasets.sample.data_path(force_update=True)

Best wishes,
Richard

Hi @richard thank you for your answer! Indeed, that and a better network connection solved my issue. Thank you!

Cool!

@larsoner @drammock Do you think we could expand the error message and instruct users to do what I suggested in my solution?

go for it @richard! :pray:

Implemented by @larsoner in ENH: Better corruption error message by larsoner · Pull Request #11407 · mne-tools/mne-python · GitHub