-
Notifications
You must be signed in to change notification settings - Fork 109
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
Error reading some .nii.gz files #52
Comments
Did you send me the wrong file? If I download the linked file it's a zero byte file? |
The online error also looks like the error from #50 that was caused by not handling errors while reading empty files. If you're still seeing that online you may want to try clearing your cache. And if that fixes it we probably want to implement cache busting during every change. |
Here's a correct link |
Thanks. It looks like some files are not making it through gzip decompression. I'm looking into it. |
I'm having difficulty reproducing this identically. Both of the above files are working for me if I add them to a valid dataset. I tried validating my local version of ds109 and got the decompressing error for one file. I then tested decompressing in OSX by double clicking it and it decompressed to a .cpgz file which then decompresses to a .gz and loops like that forever. That file will still read in mango viewer. I added the above pull request so that the errors will at least match in the browser and CLI, but I'm continuing to look into this issue. |
I've figured out what is happening with my data and I'm hoping it's the same with yours. I get this issue when a scan ends in the .gz extension but is not actually gzipped. A good test is the unix When this issue occurs I can either detect it and silently read the file while skipping the compression step or I can throw an error or warning with a message that the file ends in .gz but does not appear to be gzipped. I'm guessing we want to throw this an an error because it could cause analysis issues down the road, but let me know if you prefer something else. I'll add these changes to the currently open pull request "unzip fail". |
I cannot confirm your theory that those files are not compressed:
|
Yea that's definitely not what I was experiencing with different files.
I'm somewhat stumped at this point. The above file from ds109 has the .gz without compression issue for me. Other than that there are no file reading issues for me in that dataset. And the two files you linked above work without file reading issues if I add them to a dataset. Is it possible the linked files differ from the versions you have locally or that our ds109 datasets have diverged? I did go ahead and update the |
I am still experiencing problems with both master and unzip-fail branches:
Here's the file in question: https://docs.google.com/uc?id=0B77zr9yIiKOTRDJDTTR2QkJfMTA&export=download |
I downloaded that file and added it to a known good dataset and it validated without the file reading error in the currently deployed web demo and the master branch of the CLI. Is it possible this issue is caused by sym-linking? I noticed "symlinked" in your file path. How are you accessing these files? And are you using an older file reading testing script "nameOfFile.js"? It's possible that it's doing something the actual validator isn't. I also added a log for the header values of that file.
And got the following values.
|
I just tested with a symlinked directory without any issues. The symlink and the actual files were on the same hard-drive so I suppose there could be an issue in a more complicated symlink situation. |
Found it! It breaks with node 5.1! Works for 4.2.2. Could you try to replicate? |
Nice work! I was able to reproduce this. Looks like zlib (node's default compression library) has changed behavior somewhere along the way. Still researching what exactly is happening. |
So this is still proving somewhat complicated. It looks like we were unknowingly taking advantage of a bug. There was previously a bug in zlib for node that would not throw errors for truncated inputs (partial files) and they patched that in v5.0.0. https://nodejs.org/en/blog/release/v5.0.0/ I've added a fix to the unzip fail branch to circumvent this by handling the error with streams but as of right now it's not a great/robust solution. I still need to ensure it's handling cases where files are not actually zipped and ensure the first stream chunk is at least 500 bytes. I've also reached out to stackoverflow and node's github issues to see if there are known solutions to working with partial files in node zlib. I'll keep you posted. |
I'm getting errors reading this file https://drive.google.com/folderview?id=0B2JWN60ZLkgkcndhTWpLYmswRDA&usp=sharing&tid=0B2JWN60ZLkgkN0dMTVQ1QU1IUEk (actually all nifti files from this dataset - ds109):
On commandline:
With the online version when I try to validate full version of ds109 I get an JS error:
(which is also concerning - why would I get a different error on command line and online?)
BTW the file is not corrupted:
The text was updated successfully, but these errors were encountered: