poldracklab / tacc-openneuro

0 stars 1 forks source link

ds003459-mriqc: "OSError: Error occurred while trying to decode JSON" #51

Open jbwexler opened 1 year ago

jbwexler commented 1 year ago

task-visortho_bold.json seems to be the culprit, possibly something related to a backslash in the json file? It doesn't pass an online json validator. I'm not sure if it's related or not, but bids-validator gives me the following error for this dataset:

bids-validator@1.9.9 (node:319550) Warning: Closing directory handle on garbage collection (Use node --trace-warnings ... to show where the warning was created) 1: [ERR] Internal error. SOME VALIDATION STEPS MAY NOT HAVE OCCURRED (code: 0 - INTERNAL ERROR) Evidence: TypeError: Cannot convert undefined or null to object at Function.entries () at BidsSidecar.filterHedStrings (/work2/03201/jbwexler/frontera/anaconda3/envs/bids-validator/lib/node_modules/bids-validator/dist/commonjs/cli.js:135498:43) at new BidsSidecar (/work2/03201/jbwexler/frontera/anaconda3/envs/bids-validator/lib/node_modules/bids-validator/dist/commonjs/cli.js:135494:18) at /work2/03201/jbwexler/frontera/anaconda3/envs/bids-validator/lib/node_modules/bids-validator/dist/commonjs/cli.js:153338:12 at Array.map () at constructSidecarData (/work2/03201/jbwexler/frontera/anaconda3/envs/bids-validator/lib/node_modules/bids-validator/dist/commonjs/cli.js:153337:30) at checkHedStrings (/work2/03201/jbwexler/frontera/anaconda3/envs/bids-validator/lib/node_modules/bids-validator/dist/commonjs/cli.js:153303:23) at Object.events_default (/work2/03201/jbwexler/frontera/anaconda3/envs/bids-validator/lib/node_modules/bids-validator/dist/commonjs/cli.js:153380:10) at /work2/03201/jbwexler/frontera/anaconda3/envs/bids-validator/lib/node_modules/bids-validator/dist/commonjs/cli.js:154256:28

Here's the stderr output from mriqc:

Traceback (most recent call last): File "/opt/conda/lib/python3.9/site-packages/bids/layout/index.py", line 269, in load_json return json.load(handle) File "/opt/conda/lib/python3.9/json/init.py", line 293, in load return loads(fp.read(), File "/opt/conda/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/opt/conda/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/opt/conda/lib/python3.9/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid \escape: line 4 column 1710 (char 1991)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/conda/bin/mriqc", line 8, in sys.exit(main()) File "/opt/conda/lib/python3.9/site-packages/mriqc/cli/run.py", line 39, in main parse_args() File "/opt/conda/lib/python3.9/site-packages/mriqc/cli/parser.py", line 449, in parse_args config.from_dict(vars(opts)) File "/opt/conda/lib/python3.9/site-packages/mriqc/config.py", line 588, in from_dict execution.load(settings) File "/opt/conda/lib/python3.9/site-packages/mriqc/config.py", line 227, in load cls.init() File "/opt/conda/lib/python3.9/site-packages/mriqc/config.py", line 466, in init cls._layout = BIDSLayout( File "/opt/conda/lib/python3.9/site-packages/bids/layout/layout.py", line 152, in init indexer(self) File "/opt/conda/lib/python3.9/site-packages/bids/layout/index.py", line 111, in call self._index_metadata() File "/opt/conda/lib/python3.9/site-packages/bids/layout/index.py", line 375, in _index_metadata file_md.update(pl()) File "/opt/conda/lib/python3.9/site-packages/bids/layout/index.py", line 272, in load_json raise IOError(msg) from e OSError: Error occurred while trying to decode JSON from file /scratch1/03201/jbwexler/openneuro_derivatives/derivatives/mriqc/ds003459-mriqc/sourcedata/raw/task-visortho_bold.json

effigies commented 1 year ago

There are backslashes in a string that need to be escaped.

jbwexler commented 1 year ago

Do you think that's a change I can make myself to the dataset on openneuro without permission from the owner?

effigies commented 1 year ago

I guess I'd ping the owner first, but yeah, I wouldn't be overly fussed about it as it's a technical, not editorial fix. There are four files that show up as not JSON:

$ file **/*.json
dataset_description.json:  JSON data
participants.json:         JSON data
phenotype/ctopp.json:      JSON data
phenotype/ppvt-iii.json:   JSON data
phenotype/wisc-iii.json:   JSON data
phenotype/wj-iii.json:     JSON data
phenotype/wrat-3.json:     JSON data
T1w.json:                  JSON data
task-audortho_bold.json:   JSON data
task-audortho_events.json: JSON data
task-audphono_bold.json:   JSON data
task-audphono_events.json: JSON data
task-audsem_bold.json:     JSON data
task-audsem_events.json:   JSON data
task-audsynt_bold.json:    JSON data
task-audsynt_events.json:  JSON data
task-visortho_bold.json:   ASCII text, with very long lines (2081)
task-visortho_events.json: JSON data
task-visphono_bold.json:   ASCII text, with very long lines (2025)
task-visphono_events.json: JSON data
task-vissem_bold.json:     ASCII text, with very long lines (1629)
task-vissem_events.json:   JSON data
task-vissynt_bold.json:    ASCII text, with very long lines (1592)
task-vissynt_events.json:  JSON data
jbwexler commented 1 year ago

Thanks, I'll send them an email.

jbwexler commented 2 months ago

Getting this with fmriprep on ds001241 and ds002116.