diff --git a/lib/galaxy/metadata/set_metadata.py b/lib/galaxy/metadata/set_metadata.py index ff9380ece0b4..b512f3f905b5 100644 --- a/lib/galaxy/metadata/set_metadata.py +++ b/lib/galaxy/metadata/set_metadata.py @@ -449,6 +449,7 @@ def set_meta(new_dataset_instance, file_dict): partial(push_if_necessary, object_store, dataset, external_filename) ) object_store_update_actions.append(partial(reset_external_filename, dataset)) + object_store_update_actions.append(partial(dataset.set_total_size)) object_store_update_actions.append(partial(export_store.add_dataset, dataset)) if dataset_instance_id not in unnamed_id_to_path: object_store_update_actions.append(partial(collect_extra_files, object_store, dataset, ".")) diff --git a/lib/galaxy/model/base.py b/lib/galaxy/model/base.py index 064ee8e2e5a0..fef5a65865a1 100644 --- a/lib/galaxy/model/base.py +++ b/lib/galaxy/model/base.py @@ -155,7 +155,7 @@ def versioned_objects_strict(iter): raise Exception(f"HistoryDatsetAssociation {obj} without history detected, this is not valid") elif not obj.hid: raise Exception(f"HistoryDatsetAssociation {obj} without hid, this is not valid") - elif obj.dataset.file_size is None: + elif obj.dataset.file_size is None and obj.dataset.in_ready_state(): raise Exception(f"HistoryDatsetAssociation {obj} with null file size, this is not valid") yield obj diff --git a/lib/galaxy/model/store/discover.py b/lib/galaxy/model/store/discover.py index 832357acb45b..a213327f9618 100644 --- a/lib/galaxy/model/store/discover.py +++ b/lib/galaxy/model/store/discover.py @@ -265,6 +265,8 @@ def set_datasets_metadata(datasets, datasets_attributes=None): except Exception: log.exception("Exception occured while setting dataset peek") + primary_data.set_total_size() + def populate_collection_elements( self, collection,