# Error when 'run' BIDS entity is not specified in MNE-BIDS-Pipeline

**URL:** <https://mne.discourse.group/t/error-when-run-bids-entity-is-not-specified-in-mne-bids-pipeline/10981>\
**Category:** Support & Discussions\
**Tags:** mne-bids-pipeline\
**Created:** [March 20, 2025, 10:40am UTC](https://mne.discourse.group/t/error-when-run-bids-entity-is-not-specified-in-mne-bids-pipeline/10981 "2025-03-20T10:40:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![allermat](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/allermat/32/43_2.png) [@allermat](https://mne.discourse.group/u/allermat)\
**Post date:** [March 20, 2025, 10:40am UTC](https://mne.discourse.group/t/error-when-run-bids-entity-is-not-specified-in-mne-bids-pipeline/10981/1 "2025-03-20T10:40:32Z")

</div>

Hi,

when processing the MEG file named `sub-CC120049_ses-P2_task-rest_meg.fif` with the MNE-BIDS-Pipeline we get the following error:

```python
:x: sub-CC120049 ses-P2 run-rest A critical error occurred. 
The error message was: 'raw_task-rest_run-None' Aborting pipeline run. 
The traceback is: File "/imaging/local/software/miniconda/envs/camcan/lib/python3.10/site-packages/mne_bids_pipeline/steps/preprocessing/_01_data_quality.py", line 80, in assess_data_quality bids_path_in = in_files.pop(key)

```

The only way to solve this was to specify the `<run>` BIDS entity, however there is only one run of this taks so this shouldn’t be necessary to specify according to the [BIDS specification](https://bids-specification.readthedocs.io/en/stable/appendices/entities.html#run) as the `<run>` entity is optional.

Did we miss something or is this perhaps a bug in the pipeline?

Many thanks,  
Máté

- MNE version: 1.9.0
- MNE-BIDS-Pipeline version: 1.9
- operating system: Linux-3.10.0-1160.el7.x86\_64-x86\_64-with-glibc2.17
