From b5d0030b3ed4bf08aa26c29b72c4f5757874669c Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 19 Jan 2018 12:15:14 +0100 Subject: [PATCH] Fix history import by file on multi-handler setups The uploaded archive was going to be deleted before the job started running. --- lib/galaxy/webapps/galaxy/controllers/history.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/galaxy/webapps/galaxy/controllers/history.py b/lib/galaxy/webapps/galaxy/controllers/history.py index a2d5f4cb38e..85287f5e50b 100644 --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -1155,6 +1155,9 @@ class HistoryController(BaseUIController, SharableMixin, UsesAnnotations, UsesIt archive_url = kwargs.get('archive_url', None) archive_source = None if hasattr(archive_file, 'file'): + # archive_file.file is a TemporaryFile and will be deleted once it is closed. + # We prevent this by setting `delete` to `False`. + archive_file.file.delete = False archive_source = archive_file.file.name archive_type = 'file' elif archive_url: