galaxyproject / galaxyproject/galaxy
KeyError: 'Dataset collection has no element_index with key 0.'
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 169
Description
What happened here is that a discovered list collection didn't produce any datasets. Should fail with a better error or pass and fail on the next step ?
Sentry Issue: [GALAXY-MAIN-1148](https://sentry.galaxyproject.org/organizations/galaxy/issues/205326/?referrer=github_integration)
```
KeyError: 'Dataset collection has no element_index with key 0.'
(5 additional frame(s) were not displayed)
...
File "galaxy/model/dataset_collections/structure.py", line 190, in dict_map
return {k: func(v) for k, v in input_dict.items()}
File "galaxy/model/dataset_collections/structure.py", line 190, in
return {k: func(v) for k, v in input_dict.items()}
File "galaxy/model/dataset_collections/structure.py", line 108, in
sub_collections = dict_map(lambda collection: get_element(collection).child_collection, collection_dict)
File "galaxy/model/dataset_collections/structure.py", line 96, in get_element
return collection[index] # noqa: B023
File "galaxy/model/__init__.py", line 6900, in __getitem__
raise KeyError(error_message)
Failed to execute scheduled workflow.
```
Contributor guide
Research direction
Start by reading galaxy/model/dataset_collections/structure.py around dict_map and get_element, then inspect galaxy/model/__init__.py around __getitem__. Reproduce the empty discovered list collection if possible and determine whether the intended result is an earlier error or deferred failure; the issue is done when that behavior is explicit and the scheduled workflow no longer produces this unhandled KeyError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100