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.