bids-standard / legacy-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/legacy-validator/
MIT License
185 stars 110 forks source link

1.7.2: Uninformative failure when running on non-fetched git-annexed files #1288

Open yarikoptic opened 3 years ago

yarikoptic commented 3 years ago

ran from a singularity image on a datalad dataset in elderly git annex direct mode:

(datalad) [d31548v@discovery7 data_discovery]$ singularity run -B $PWD /XXX/bidsvalidator-1.7.2.sif $PWD
bids-validator@1.7.2

Unhandled rejection (
  reason: TypeError: Cannot read property 'length' of undefined
    at fileArrayToObject (/src/utils/files/readDir.js:39:33)
    at Object.readDir (/src/utils/files/readDir.js:27:17)

might be because some files are still not fetched annexed files. But it shouldn't crash like this - should tell what directory at least it has an issue with

sappelhoff commented 3 years ago

I got the same issue with the docker image after datalad cloneing a dataset and running bids-validator without datalad getting all files first.

I agree that an error message instead of a crash would be nice - but I wouldn't know where to start to make a PR for this.