From b2cd38be60676bbb6f588d41442ca66f2c2f055e Mon Sep 17 00:00:00 2001 From: Abderrahim Kitouni Date: Sun, 24 Aug 2025 21:41:18 +0100 Subject: [PATCH] _sandboxreapi: check stdout and stderr exist when fetching action result Starting with b8e6876d760641c2b6ccc3e2578eba48d0a33332, action results generated by the buildbox-run sandbox may be pushed to the action cache, and they don't have stderr and stdout stored. --- src/buildstream/sandbox/_sandboxreapi.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/buildstream/sandbox/_sandboxreapi.py b/src/buildstream/sandbox/_sandboxreapi.py index 9b95f63fa..be210e450 100644 --- a/src/buildstream/sandbox/_sandboxreapi.py +++ b/src/buildstream/sandbox/_sandboxreapi.py @@ -184,8 +184,13 @@ def _fetch_action_result_outputs(self, casremote, action_result): raise SandboxError("Output directory structure had no digest attached.") - # Fetch stdout and stderr blobs - cascache.fetch_blobs(casremote, [action_result.stdout_digest, action_result.stderr_digest]) + # Fetch stdout and stderr blobs, if they exist + blobs = [] + for digest in [action_result.stdout_digest, action_result.stderr_digest]: + if digest.hash: + blobs.append(digest) + if blobs: + cascache.fetch_blobs(casremote, blobs) def _process_job_output(self, working_directory, output_directories, output_files, *, failure): # Reads the remote execution server response to an execution request.