bids-validator
bids-validator copied to clipboard
Annexed files without local content crash validation
trafficstars
This is for the schema validator.
error: Uncaught NotFound: No such file or directory (os error 2), open '/home/nell/Git/crn/datasets/ds000117/sub-01/ses-mri/anat/sub-01_ses-mri_acq-mprage_T1w.nii.gz'
return Deno.openSync(this._getPath(), openOptions)
^
at Object.openSync (deno:runtime/js/40_files.js:40:21)
at BIDSFileDeno.#openHandle (file:///home/nell/Git/crn/bids-validator/bids-validator/src/files/deno.ts:108:17)
at BIDSFileDeno.readBytes (file:///home/nell/Git/crn/bids-validator/bids-validator/src/files/deno.ts:94:36)
at loadHeader (file:///home/nell/Git/crn/bids-validator/bids-validator/src/files/nifti.ts:5:20)
at BIDSContext.loadNiftiHeader (file:///home/nell/Git/crn/bids-validator/bids-validator/src/schema/context.ts:155:27)
at BIDSContext.asyncLoads (file:///home/nell/Git/crn/bids-validator/bids-validator/src/schema/context.ts:185:10)
at async validate (file:///home/nell/Git/crn/bids-validator/bids-validator/src/validators/bids.ts:77:5)
at async main (file:///home/nell/Git/crn/bids-validator/bids-validator/src/main.ts:23:24)
at async file:///home/nell/Git/crn/bids-validator/bids-validator/src/main.ts:41:1
This should probably throw a validation error in this situation but we want a flag to not read file contents that would also avoid this error. Open question, should we automatically ignore missing file contents when we see a git-annex dataset or is that too magic?
Not sure if this is done, so bumping it for your consideration, @nellh.
This is fixed, there could be some improvements to handling the missing content but the important part of not crashing in this situation is handled.