FMRIPREP from Singularity: UnboundLocalError

Sure, here you go:

sourcedata/
   sub-01/
      anat/      
         sub-01_T1w.json
         sub-01_T1w.nii
      fmap/      
         sub-01_run-1_magnitude1.nii
         sub-01_run-1_magnitude2.nii
         sub-01_run-1_phasediff.json
         sub-01_run-1_phasediff.nii
         sub-01_run-2_magnitude1.nii
         sub-01_run-2_magnitude2.nii
         sub-01_run-2_phasediff.json
         sub-01_run-2_phasediff.nii
      func/      
         sub-01_task-AudLoc_echo-1_bold.json
         sub-01_task-AudLoc_echo-1_bold.nii
         sub-01_task-AudLoc_echo-2_bold.json
         sub-01_task-AudLoc_echo-2_bold.nii
         sub-01_task-AudLoc_events.tsv
         sub-01_task-FJT_echo-1_bold.json
         sub-01_task-FJT_echo-1_bold.nii
         sub-01_task-FJT_echo-2_bold.json
         sub-01_task-FJT_echo-2_bold.nii
         sub-01_task-FJT_events.tsv
         sub-01_task-LDT_echo-1_bold.json
         sub-01_task-LDT_echo-1_bold.nii
         sub-01_task-LDT_echo-2_bold.json
         sub-01_task-LDT_echo-2_bold.nii
         sub-01_task-LDT_events.tsv
         sub-01_task-MotLoc_echo-1_bold.json
         sub-01_task-MotLoc_echo-1_bold.nii
         sub-01_task-MotLoc_echo-2_bold.json
         sub-01_task-MotLoc_echo-2_bold.nii
         sub-01_task-MotLoc_events.tsv

Most other subjects have the same exact structure, with the exception of 3 subjects with an additional fieldmap (run-3) as they had to be taken out of and back in to the scanner within a session.

EDIT: fmriprep fails with the same error message posted above on every subject.