Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"[...] is not a gzip file" #108

Closed
arokem opened this issue Oct 9, 2023 · 8 comments
Closed

"[...] is not a gzip file" #108

arokem opened this issue Oct 9, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@arokem
Copy link

arokem commented Oct 9, 2023

A pyAFQ user reported that they are seeing the following error:

"nibabel.filebasedimages.ImageFileError: File C:\Users\Leqing Zhou.cache\templateflow\tpl-MNI152NLin2009cAsym\tpl-MNI152NLin2009cAsym_res-01_T1w.nii.gz is not a gzip file"

What should they do to recover from this state of affairs?

@arokem
Copy link
Author

arokem commented Oct 9, 2023

cc @RosieZho, @66RuixiZheng

@mgxd
Copy link
Contributor

mgxd commented Oct 9, 2023

Seems like the file is corrupt - I'd try clearing the local templateflow directory ($HOME/.cache/templateflow) and redownload the data. You can use the following command, assuming you have templateflow installed in your current python environment.

python -c "import templateflow.api as tf; tf.get('MNI152NLin2009cAsym', resolution=1, desc=None, suffix='T1w')"

@ZhengRuixi
Copy link

I tried invoking the command and it still doesn't work, but the following warning appears, ‘repository not found at <C:\Users\Administrator.cache\templateflow>. Populating a new TemplateFlow stub. If the path reported above is not the desired location for TemplateFlow, please set the TEMPLATEFLOW_HOME environment variable.’

@mgxd
Copy link
Contributor

mgxd commented Oct 10, 2023

Ah, I see you're on windows - you might want to check:

%userprofile%\.cache\templateflow

This should be the default location, but you can alter this by setting the TEMPLATEFLOW_HOME environment variable to a custom path.

@effigies
Copy link
Contributor

effigies commented Nov 3, 2023

Is this still open? @RosieZho @66RuixiZheng @arokem

@oesteban oesteban added the bug Something isn't working label Mar 15, 2024
@oesteban
Copy link
Member

@RosieZho switched to a matlab version of AFQ so I assume templateflow is not used there.

@ZhengRuixi, did you resolve the issue?

Deleting the templateflow cache would be a first step to solve this.

@oesteban
Copy link
Member

@mgxd given the prevalence of this kind of issues when pulling from S3, we should probably check MD5 sums or try to open the file with nibabel after a download, don't you think?

@oesteban
Copy link
Member

I believe this is a duplicate of #53. Since my comment is sort of suggested there, let's move the conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants