From bdc6b6ae3b7394da8685923bef5f9cf8faf6b4a7 Mon Sep 17 00:00:00 2001 From: Sav <74550527+sberss@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:21:03 +0000 Subject: [PATCH 1/2] feat: upload rc, stderr and stdout on failure --- .../cromwell/backend/impl/aws/AwsBatchJob.scala | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/supportedBackends/aws/src/main/scala/cromwell/backend/impl/aws/AwsBatchJob.scala b/supportedBackends/aws/src/main/scala/cromwell/backend/impl/aws/AwsBatchJob.scala index 27751b5e797..8e018cd4964 100755 --- a/supportedBackends/aws/src/main/scala/cromwell/backend/impl/aws/AwsBatchJob.scala +++ b/supportedBackends/aws/src/main/scala/cromwell/backend/impl/aws/AwsBatchJob.scala @@ -577,7 +577,6 @@ final case class AwsBatchJob( replaced.patch(insertionPoint, preamble, 0) + s""" |{ - |set -e |# (re-)add tags to include added volumes: |if [[ "${doTagging}" == "true" ]]; then | echo "*** TAGGING RESOURCES ***" @@ -588,15 +587,20 @@ final case class AwsBatchJob( |DELOCALIZATION_FAILED=0 |$outputCopyCommand |echo "DELOCALIZATION RESULT: $$DELOCALIZATION_FAILED" + |rc=$$(head -n 1 $workDir/${jobPaths.returnCodeFilename} 2>/dev/null) || rc=1 |if [[ $$DELOCALIZATION_FAILED -eq 1 ]]; then | echo '*** DELOCALIZATION FAILED ***' - | echo '*** EXITING WITH RETURN CODE 1***' - | exit 1 + | if [[ "$$rc" -eq 0 ]]; then + | echo '*** EXITING WITH RETURN CODE 1 ***' + | exit 1 + | else + | echo "*** EXITING WITH ORIGINAL RETURN CODE $$rc ***" + | exit $$rc + | fi |else | echo '*** COMPLETED DELOCALIZATION ***' |fi |echo '*** EXITING WITH RETURN CODE ***' - |rc=$$(head -n 1 $workDir/${jobPaths.returnCodeFilename}) |echo $$rc |exit $$rc |} From a6c127942a127a21908997e215f7aebccd4d6d7b Mon Sep 17 00:00:00 2001 From: Sav <74550527+sberss@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:21:09 +0000 Subject: [PATCH 2/2] chore: update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e721be423a..64cdcb09958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ The index `IX_METADATA_ENTRY_WEU_CFQN_JSI_JRA_MK` is added to `METADATA_ENTRY`. This index supports planned metadata API enhancements that enable querying at granular scopes, namely calls, shards, and attempts. +### AWS Batch +* Fixed an issue where job failures before all outputs were written would cause delocalization to fail, preventing the upload of return code, stdout, and stderr files needed for debugging. + ## 91 Release Notes #### Removal of Google LifeSciences backend code