Open kabilar opened 4 months ago
These messages are hard to parse by eye, and even then the error is just "File does not match any pattern known to BIDS". It would be super useful if there was some hint (maybe at least a link to the BIDS spec?) on how the file pattern can be fixed.
I don't think there is an easy generic way to address this reliably. Only may be for some cases to look at what entities used and either all are known and suggest closest matching legit ones if some nonlegit ones used.
May be if you provide some specific suggestions, we could see if could be coded up.
Reposting a suggestion that @dstansby provided on the LINC Client (https://github.com/lincbrain/linc-cli/issues/44):
I'm currently trying to upload a dataset, and if there's a validation error it's a bit tricky to understand what went wrong and how I can fix it. The output looks like this:
If I then go into the log, I see messages like
Example full log
``` 2024-05-02T14:40:51+0100 [INFO ] dandi 23264:16516 lincbrain v0.5.0+108.g40a8c76b.dirty, hdmf v3.13.0, pynwb v2.6.0, h5py v3.11.0 2024-05-02T14:40:51+0100 [INFO ] dandi 23264:16516 sys.argv = ['C:\\Users\\dstansby\\miniforge3\\envs\\linc\\Scripts\\lincbrain', 'upload'] 2024-05-02T14:40:51+0100 [INFO ] dandi 23264:16516 os.getcwd() = C:\Users\dstansby\data\linc\000005 2024-05-02T14:40:51+0100 [DEBUG ] urllib3.connectionpool 23264:16516 Starting new HTTPS connection (1): rig.mit.edu:443 2024-05-02T14:40:52+0100 [DEBUG ] urllib3.connectionpool 23264:16516 https://rig.mit.edu:443 "GET /et/projects/linc/linc-cli HTTP/1.1" 404 44 2024-05-02T14:40:52+0100 [DEBUG ] dandi 23264:16516 Could not check linc/linc-cli for version updates: 404 Client Error: Not Found for url: https://rig.mit.edu/et/projects/linc/linc-cli 2024-05-02T14:40:52+0100 [DEBUG ] urllib3.connectionpool 23264:16516 Starting new HTTPS connection (1): api.lincbrain.org:443 2024-05-02T14:40:52+0100 [DEBUG ] urllib3.connectionpool 23264:16516 https://api.lincbrain.org:443 "GET /api/info/ HTTP/1.1" 200 371 2024-05-02T14:40:52+0100 [DEBUG ] dandi 23264:16516 GET https://api.lincbrain.org/api/info/ 2024-05-02T14:40:52+0100 [DEBUG ] urllib3.connectionpool 23264:16516 Starting new HTTPS connection (1): api.lincbrain.org:443 2024-05-02T14:40:53+0100 [DEBUG ] urllib3.connectionpool 23264:16516 https://api.lincbrain.org:443 "GET /api/info/ HTTP/1.1" 200 371 2024-05-02T14:40:53+0100 [DEBUG ] dandi 23264:16516 Response: 200 2024-05-02T14:40:53+0100 [DEBUG ] dandi 23264:16516 Using api key from LINCBRAIN_API_KEY environment variable 2024-05-02T14:40:53+0100 [DEBUG ] dandi 23264:16516 GET https://api.lincbrain.org/api/auth/token 2024-05-02T14:40:53+0100 [DEBUG ] urllib3.connectionpool 23264:16516 https://api.lincbrain.org:443 "GET /api/auth/token HTTP/1.1" 301 0 2024-05-02T14:40:53+0100 [DEBUG ] urllib3.connectionpool 23264:16516 https://api.lincbrain.org:443 "GET /api/auth/token/ HTTP/1.1" 200 42 2024-05-02T14:40:53+0100 [DEBUG ] dandi 23264:16516 Response: 200 2024-05-02T14:40:53+0100 [DEBUG ] dandi 23264:16516 Found identifier DANDI:000005 in top level 'identifier' 2024-05-02T14:40:53+0100 [DEBUG ] h5py._conv 23264:16516 Creating converter from 7 to 5 2024-05-02T14:40:53+0100 [DEBUG ] h5py._conv 23264:16516 Creating converter from 5 to 7 2024-05-02T14:40:53+0100 [DEBUG ] h5py._conv 23264:16516 Creating converter from 7 to 5 2024-05-02T14:40:53+0100 [DEBUG ] h5py._conv 23264:16516 Creating converter from 5 to 7 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'zlib' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'gzip' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'bz2' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'lzma' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'blosc' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'zstd' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'lz4' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'astype' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'delta' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'quantize' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'fixedscaleoffset' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'packbits' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'categorize' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'pickle' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'base64' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'shuffle' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'bitround' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'crc32' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'adler32' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'jenkins_lookup3' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'json2' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'vlen-utf8' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'vlen-bytes' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'vlen-array' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'fletcher32' 2024-05-02T14:40:53+0100 [DEBUG ] numcodecs 23264:16516 Registering codec 'n5_wrapper' 2024-05-02T14:40:54+0100 [INFO ] dandi 23264:16516 Found 6 files to consider 2024-05-02T14:40:55+0100 [WARNING ] bids-schema 23264:17416 No BIDS reference root provided. 2024-05-02T14:40:55+0100 [INFO ] bids-schema 23264:17416 No schema path specified, defaulting to the bundled schema, `C:\Users\dstansby\miniforge3\envs\linc\Lib\site-packages\bidsschematools\data\schema`. 2024-05-02T14:40:55+0100 [WARNING ] bids-schema 23264:17416 The `C:/Users/dstansby/data/linc/000005/rawdata/sub-S45/sub-S45_sample-fullhemisphere_PC.ome.zarr/` file was not matched by any regex schema entry. 2024-05-02T14:40:56+0100 [WARNING ] dandi 23264:17416 'C:\\Users\\dstansby\\data\\linc\\000005\\dataset_description.json' had 1 validation errors preventing its upload: 2024-05-02T14:40:56+0100 [WARNING ] dandi 23264:17416 Error 1: ValidationResult(id='BIDS.NON_BIDS_PATH_PLACEHOLDER', origin=ValidationOrigin(name='bidsschematools', version='0.7.2', bids_version='1.9.0-dev'), scope=These messages are hard to parse by eye, and even then the error is just "File does not match any pattern known to BIDS". It would be super useful if there was some hint (maybe at least a link to the BIDS spec?) on how the file pattern can be fixed.
Related issue:
Thank you
cc @dstansby @aaronkanzer