Malformed or missing manifest.name gives opaque error / IndexError instead of a lint failure
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 322
- Forks
- 255
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 5
Description
Description of the bug
nf-core pipelines lint handles a malformed or missing manifest.name badly, in two distinct ways depending on the value.
namepresent but without a/(e.g.name = 'My-Pipeline') - lint aborts with a single line and no traceback:
ERROR not enough values to unpack (expected 2, got 1)
Nothing indicates which config field is at fault. --verbose does not help: the debug output ends at config loading and the same bare ERROR follows, with no frame information. The abort happens before Testing pipeline: is printed, so it occurs during pipeline init rather than in a lint test.
nameabsent entirely - the fallback engages, then crashes downstream:
INFO Testing pipeline: /path/to/pipeline
WARNING Expected manifest.name to be in the format '<repo>/<pipeline>'. Will assume it is '<pipeline>'.
...
│ /usr/local/lib/python3.12/site-packages/nf_core/pipelines/lint/__init__.py:276 in _lint_pipeline │
│ ❱ 276 │ test_results = getattr(self, test_name)() │
│ /usr/local/lib/python3.12/site-packages/nf_core/pipelines/lint/files_exist.py:201 in files_exist │
│ ❱ 201 │ Path("lib", f"Workflow{short_name[0].upper()}{short_name[1:]}.groovy"), │
IndexError: string index out of range
short_name is "" here, and line 201 indexes short_name[0].
Neither case is reported as a lint failure, and in case 1 there is no way for a user to tell that manifest.name is the cause.
Related unguarded split sites in the lint code:
nf_core/pipelines/lint/files_exist.py:125 _, short_name = pipeline_name.split("/")
nf_core/pipelines/lint/files_unchanged.py:74 prefix, short_name = manifest_config.get("name", "").split("/")
The second is the same pattern reported in #2445, and its "" default cannot unpack either. Both run after Testing pipeline: is printed, so neither is the source of case 1 - that call site is earlier and I was not able to locate it from the CLI output.
Setting name = 'abc/My-Pipeline' resolves both.
Two suggested fixes:
- Validate
manifest.nameduring pipeline init and raiseUserWarning("manifest.name must be in the format '<repo>/<pipeline>'"), sorun_lintingreports it as a lint failure with a message naming the field, in both cases. - In
files_exist.py:201, useshort_name[:1].upper()instead ofshort_name[0].upper()so an empty name cannot raiseIndexError.
Command used and terminal output
CASE 1:
$ nf-core pipelines lint
nf-core/tools version 4.1.0 - https://nf-co.re
ERROR not enough values to unpack (expected 2, got 1)
CASE 2:
INFO Testing pipeline: /path/to/pipeline
WARNING Expected manifest.name to be in the format '<repo>/<pipeline>'. Will assume it is '<pipeline>'.
│ /usr/local/lib/python3.12/site-packages/nf_core/pipelines/lint/__init__.py:276 in _lint_pipeline │
│ ❱ 276 │ test_results = getattr(self, test_name)() │
│ /usr/local/lib/python3.12/site-packages/nf_core/pipelines/lint/files_exist.py:201 in files_exist │
│ ❱ 201 │ Path("lib", f"Workflow{short_name[0].upper()}{short_name[1:]}.groovy"), │
IndexError: string index out of range
Reproducers, both on the same pipeline:
Case 1: manifest { name = 'My-Pipeline' }
Case 2: manifest block with no name entry
nf-core/tools is installed as an Apptainer image invoked through a wrapper (apptainer exec nfcore_4.1.0a.sif /usr/local/bin/nf-core "$@"), so the Python is the image's.
System information
- Nextflow version: 25.04.4
- Hardware: HPC
- Executor: slurm
- OS: Rocky Linux 8.10 (Green Obsidian)
- Version of nf-core/tools: 4.1.0
- Python version: 3.12.13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with nf_core/pipelines/lint/init.py around _lint_pipeline, then inspect the split sites in files_exist.py and files_unchanged.py, including files_exist.py:201. Run nf-core pipelines lint against the two manifest reproducers; done means malformed or missing manifest.name is reported as a named lint failure rather than an unpacking error or IndexError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100