Skip to content

Error with workflow testing: Would be good to 'sanitize' destination #1365

@lldelisle

Description

@lldelisle

I got an error when testing a workflow:

waiting for invocation 8fef1c524c0a58fb
Failed to execute Galaxy activity, throwing ErrorRunResponse
Traceback (most recent call last):
  File "/home/ldelisle/planemo/lib/python3.10/site-packages/planemo/galaxy/activity.py", line 72, in execute
    return _execute(ctx, config, runnable, job_path, **kwds)
  File "/home/ldelisle/planemo/lib/python3.10/site-packages/planemo/galaxy/activity.py", line 257, in _execute
    run_response.collect_outputs(ctx, output_directory)
  File "/home/ldelisle/planemo/lib/python3.10/site-packages/planemo/galaxy/activity.py", line 457, in collect_outputs
    cwl_output = output_to_cwl_json(
  File "/home/ldelisle/planemo/lib/python3.10/site-packages/galaxy/tool_util/cwl/util.py", line 488, in output_to_cwl_json
    dataset_dict = get_dataset(output_metadata)
  File "/home/ldelisle/planemo/lib/python3.10/site-packages/planemo/galaxy/activity.py", line 433, in get_dataset
    destination = self.download_output_to(ctx, dataset_details, output_directory, filename=filename)
  File "/home/ldelisle/planemo/lib/python3.10/site-packages/planemo/galaxy/activity.py", line 516, in download_output_to
    self._history_content_download(
  File "/home/ldelisle/planemo/lib/python3.10/site-packages/planemo/galaxy/activity.py", line 536, in _history_content_download
    with open(to_path, "wb") as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpu_ks3let/goseq on data 15 and data 33: DE genes for categories (GO/KEGG terms)'

The problem is that the history name has a / in its name. I think it would be good to 'sanitize' the history name before using it in:

if filename is None:
local_filename = dataset_details.get("cwl_file_name") or dataset_details.get("name")
else:
local_filename = filename
destination = os.path.join(output_directory, local_filename)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions