MRIQC with docker TypeError: sequence item 6: expected str instance, bytes found

Summary of what happened:

I get the following error when running MRIQC with docker. Any help will be appreciated.

Command used (and if a helper script was used, a link to the helper script or the command generated):


sudo docker run -it --rm -v /media/step/Elements/try/try_sub-1: /data:ro -v /media/step/Elements/try/QC: /out nipreps/mriqc:lastest /data /out participant --participant_label sub-1

Version:

24.1.0

Environment (Docker, Singularity / Apptainer, custom installation):

docker

Data formatted according to a validatable standard? Please provide the output of the validator:

Data is validated by bids-validator. When error appears, the output directory consists of two folders, anat and dwi, including one json file respectively.

Relevant log outputs (up to 20 lines):


Node: mriqc_wf.anatMRIQC.UploadMetrics
Working directory: /tmp/work/mriqc_wf/anatMRIQC/117764f3fa5b52b62f638780affda71758755753/UploadMetrics

Node inputs:

auth_token = 8sSYVI0XjFqacEMZ8wF4
email = <undefined>
endpoint = https://mriqc.nimh.nih.gov:443/api/v1 
in_iqms = /out/sub-1/anat/sub-1_T1w.json
modality = undefined
strict = False

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/mriqc/engine/plugin.py", line 64, in run_node
    result['result'] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node UploadMetrics.

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 397, in run
	    runtime = self._run_interface(runtime)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/opt/conda/lib/python3.11/site-packages/mriqc/interfaces/webapi.py", line 186, in _run_interface
	    errmsg = '\n'.join(
	             ^^^^^^^^^^
	TypeError: sequence item 6: expected str instance, bytes found

Screenshots / relevant information:

Operating System
ubuntu20.04

Hi @Candy and welcome to neurostars!

Can you:

1: try updating to most recent version (24.0.2) and try again.
2: return the tree structure of the bids directory / subject data folder.
3: provide the BIDS validation report.
4: try adding —no-sub and —notrack to MRIQC arguments.

Best,
Steven

Hi @Steven and thank you for quick response! Your suggestions are very helpful!!! I have solved this problem by adding arguments. If possible, please tell me the meaning of both two arguments or the website about the arguments.

  1. I suspect the most recent version (24.0.2) you recommend is the same version I have (24.1.0), because I find the latest QC version is 24.0.2, which was released in August 26th through git-hub website and mine is also the latest. But I don’t know why they have different names.

  2. My tree structure is following:

try_sub-1
         | - -CHANGES
         | - -dataset_description.json
         | - -participants.json
         | - -participants.tsv
         | - -README
         | - -scans.json
         | - -sub-1
                  | - -anat
                           | - -sub-1_T1w.json
                           | - -sub-1_T1w.nii.gz
                  | - -dwi
                           | - -sub-1_dwi.bval
                           | - -sub-1_dwi.bvec
                           | - -sub-1_dwi.json
                           | - -sub-1_dwi.nii.gz
                  | - -sub-1_scans.tsv

图片

  1. BIDS validation report is here: several warnings but no error. My peer can use MRIQC successfully like this.
“subCode":"DatasetType","location":"/dataset_description.json","severity":"warning","rule":"rules.dataset_metadata.dataset_description"},{"code":"JSON_KEY_RECOMMENDED","subCode":"GeneratedBy","location":"/dataset_description.json","severity":"warning","rule":"rules.dataset_metadata.dataset_description"},{"code":"JSON_KEY_RECOMMENDED","subCode":"SourceDatasets","location":"/dataset_description.json","severity":"warning","rule":"rules.dataset_metadata.dataset_description"},{"code":"README_FILE_SMALL","location":"/README","rule":"rules.checks.general.ReadmeFileSmall","severity":"warning"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"ReceiveCoilName","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"ReceiveCoilActiveElements","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"GradientSetType","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MRTransmitCoilSequence","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MatrixCoilMode","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"CoilCombinationMethod","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PulseSequenceType","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"SequenceName","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PulseSequenceDetails","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MTState","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"SpoilingState","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"NumberShots","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"ParallelReductionFactorOutOfPlane","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"ParallelAcquisitionTechnique","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PartialFourier","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PartialFourierDirection","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"EffectiveEchoSpacing","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MixingTime","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PhaseEncodingDirection","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.PhaseEncodingDirectionRec"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"TotalReadoutTime","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.PhaseEncodingDirectionRec"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"DwellTime","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRITimingParameters"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MultibandAccelerationFactor","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISliceAcceleration"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"InstitutionAddress","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIInstitutionInformation"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"InstitutionalDepartmentName","location":"/sub-1/anat/sub-1_T1w.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIInstitutionInformation"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"ReceiveCoilName","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"ReceiveCoilActiveElements","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"GradientSetType","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MRTransmitCoilSequence","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MatrixCoilMode","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"CoilCombinationMethod","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIHardware"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PulseSequenceType","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"SequenceName","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PulseSequenceDetails","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MTState","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"SpoilingState","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISequenceSpecifics"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"NumberShots","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"ParallelReductionFactorOutOfPlane","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"ParallelAcquisitionTechnique","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PartialFourier","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"PartialFourierDirection","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MixingTime","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISpatialEncoding"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"InversionTime","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRITimingParameters"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"DwellTime","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRITimingParameters"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"SliceTiming","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.SliceTimingMRI"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"SliceEncodingDirection","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.SliceTimingMRI"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"MultibandAccelerationFactor","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRISliceAcceleration"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"InstitutionAddress","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIInstitutionInformation"},{"code":"SIDECAR_KEY_RECOMMENDED","subCode":"InstitutionalDepartmentName","location":"/sub-1/dwi/sub-1_dwi.nii.gz","severity":"warning","rule":"rules.sidecars.mri.MRIInstitutionInformation"}],"codeMessages":{}},"summary":{"sessions":[],"subjects":["1"],"subjectMetadata":[{"participantId":"1","age":28,"sex":"F","group":"control"}],"tasks":[],"modalities":["MRI"],"secondaryModalities":["MRI_Diffusion","MRI_Structural"],"totalFiles":13,"size":234567742,"dataProcessed":false,"pet":{},"dataTypes":["anat","dwi"],"schemaVersion":"0.11.4-dev"}}
  1. I try adding --no-sub and --notrack to MRIQC arguments, and I am very happy to successfully obtain the output folder.

Thanks for your help!!!

Best,
Candy

Hi @Candy,

Those arguments are explained here: Running MRIQC — mriqc 24.1.0.dev5+gd7f9c89 documentation

In short, they disable two parts of the process that use the internet to track usage.

Best,
Steven

I got it ! You are so nice, steven. Please accpect my sincere thanks.

Best,
Candy

1 Like