From 41e16947cad44a44c2a79040eb5de80512d6c04c Mon Sep 17 00:00:00 2001 From: jorgee Date: Thu, 10 Jul 2025 12:39:02 +0200 Subject: [PATCH] Fix silent failure when downloading a directory with AWS SDK v2 Signed-off-by: jorgee --- .../nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java b/plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java index e405cf64a..e89141de6 100644 --- a/plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java +++ b/plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java @@ -506,7 +506,11 @@ public void downloadDirectory(S3Path source, File targetFile) throws IOException DirectoryDownload downloadDirectory = transferManager().downloadDirectory(downloadDirRequest); try{ - downloadDirectory.completionFuture().get(); + CompletedDirectoryDownload completed = downloadDirectory.completionFuture().get(); + if (!completed.failedTransfers().isEmpty()){ + log.debug("S3 download directory: s3://{}/{} failed transfers", source.getBucket(), source.getKey()); + throw new IOException("Some transfers in S3 download directory: s3://"+ source.getBucket() +"/"+ source.getKey() +" has failed - Transfers: " + completed.failedTransfers() ); + } } catch (InterruptedException e){ log.debug("S3 download directory: s3://{}/{} interrupted", source.getBucket(), source.getKey()); Thread.currentThread().interrupt();