From e80204e951a8a27b39b09ffb6c2a0119ed726f44 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 21 May 2024 14:17:57 +0200 Subject: [PATCH] Create empty primary file if we only have extra files dir --- lib/galaxy/metadata/set_metadata.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/metadata/set_metadata.py b/lib/galaxy/metadata/set_metadata.py index 221346b8b438..237b106d3c7f 100644 --- a/lib/galaxy/metadata/set_metadata.py +++ b/lib/galaxy/metadata/set_metadata.py @@ -420,11 +420,12 @@ def set_meta(new_dataset_instance, file_dict): ) dataset.dataset.created_from_basename = created_from_basename elif os.path.exists(dataset_path_to_extra_path(external_filename)): - # Only output extra files dir, but no primary output file, that's fine - if dataset.datatype.composite_type == "auto_primary_file": - with open(external_filename, "wb"): - pass - pass + # Only output is extra files dir, but no primary output file, that's fine, + # but make sure we create an empty primary output file. It's a little + # weird to do this, but it does indicate that there's nothing wrong with the file, + # as opposed to perhaps a storage issue. + with open(external_filename, "wb"): + pass else: raise Exception(f"Output file '{external_filename}' not found")