galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.38k stars 992 forks source link

`/api/workflows/{workflow_id}`: AttributeError: 'str' object has no attribute 'get' #18257

Open galaxyproject-sentryintegration[bot] opened 4 months ago

galaxyproject-sentryintegration[bot] commented 4 months ago

Sentry Issue: GALAXY-TEST-2D9

ExceptionGroup: unhandled errors in a TaskGroup
  File "starlette/_utils.py", line 87, in collapse_excgroups
    yield
  File "starlette/middleware/base.py", line 190, in __call__
    async with anyio.create_task_group() as task_group:
  File "anyio/_backends/_asyncio.py", line 678, in __aexit__
    raise BaseExceptionGroup(

AttributeError: 'str' object has no attribute 'get'
(26 additional frame(s) were not displayed)
...
  File "galaxy/webapps/galaxy/fast_app.py", line 109, in add_x_frame_options
    response = await call_next(request)
  File "galaxy/webapps/galaxy/api/workflows.py", line 1147, in show_workflow
    return self.service.show_workflow(trans, workflow_id, instance, legacy, version)
  File "galaxy/webapps/galaxy/services/workflows.py", line 242, in show_workflow
    **self._workflow_contents_manager.workflow_to_dict(trans, stored_workflow, style=style, version=version)
  File "galaxy/managers/workflows.py", line 905, in workflow_to_dict
    wf_dict = self._workflow_to_dict_instance(trans, stored, workflow=workflow, legacy=False)
  File "galaxy/managers/workflows.py", line 1635, in _workflow_to_dict_instance
    step_label = step.label or step.tool_inputs.get("name")
jdavcs commented 4 months ago

Possibly related issue on main: https://sentry.galaxyproject.org/organizations/galaxy/issues/144638/ In original issue, step.tool_inputs is a str; on main it's None. Expected to be dict.

mvdbeek commented 3 months ago
(venv) [g2test@galaxy07 galaxy]$ PYTHONPATH=lib python -i scripts/db_shell.py
>>> step = sa_session.get(WorkflowStep, 32603)
>>> step
<galaxy.model.WorkflowStep(32603) at 0x7f106477f610>
>>> step.tool_inputs
'{"__page__": null, "__rerun_remap_job_id__": null, "name": "\\"Ecoli-2_S1_L001_R2_001.fastq\\""}'

I don't think we're expecting a string here, but we could easily do json.loads() if tool_inputs is a string.