Repository navigation
Neurosynth data failed to get fetched #341
Description
Activity
Hi @sophiatinh — sorry for the delay on this. The error is from MATLAB's
unzipfailing on a partially-downloaded archive: the file at~/brainstat_data/neurosynth_data/tp28eb81f6_..._.zipis a zero-byte or truncated ZIP because the download didn't complete cleanly (the warning two lines up —Cannot open file ... Neurosynth_TFIDF__lesions_z_desc-consistency.nii.gz— is the giveaway).The Neurosynth archive is fairly large; on a slow or interrupted connection MATLAB's default
webread/websavecan time out without raising, leaving the zip half-written, and the next call then tries to unzip a corrupt file.To recover:
rmdir(fullfile(getenv('HOME'), 'brainstat_data', 'neurosynth_data'), 's')
then re-run
meta_analytic_decoder(brain, 'template', 'fsaverage5'). If the download keeps failing on the same machine, the URLmeta_analytic_decoderis hitting is recorded indata_urls.json(underneurosynth_precomputed) — you can grab that file manually with curl/wget, drop it (unzipped) into~/brainstat_data/neurosynth_data/, andmeta_analytic_decoderwill pick it up and skip the download.Could you confirm whether that resolves it? If you still hit the same error after a clean download, it's worth checking your
~/brainstat_datapartition for free space.- addedbugSomething isn't workingSomething isn't workingMATLABOn the MATLAB implementationOn the MATLAB implementation
on May 4, 2026 Hardened in #380.
fetch_neurosynth_datanow:- Validates the downloaded zip's central directory via
java.util.zip.ZipFilebeforeunzip, so a truncated download surfaces a clear error instead of crashing later. - Retries the
websave + verify + unzipflow up to 3 times, deleting partial zips between attempts. - Verifies the post-extract file count matches the manifest and gives a remediation hint if it doesn't.
- Handles a missing
data_dirgracefully.
If you still hit the same error after the merge, please reopen — likely a transient network issue at that point and worth a fresh trace.
- Validates the downloaded zip's central directory via
- added a commit that references this issue
on May 4, 2026
Thank you for making this amazing tool available for everyone!
I was trying to use the meta_analytic_decoder function from the Brainstat, however the data didn't get fetched properly (see Warnings and Error messages below). Any advice would be much appreciated!!! I'm currently using MatlabR2021b, if that helps.