diff --git a/autogpt_platform/backend/backend/util/sandbox_files.py b/autogpt_platform/backend/backend/util/sandbox_files.py index 47fc10bd36..7f767ed3ba 100644 --- a/autogpt_platform/backend/backend/util/sandbox_files.py +++ b/autogpt_platform/backend/backend/util/sandbox_files.py @@ -224,7 +224,15 @@ async def extract_sandbox_files( ) continue - file_size = int(stat_result.stdout.strip()) + try: + file_size = int(stat_result.stdout.strip()) + except ValueError: + logger.debug( + f"Skipping {file_path}: unexpected stat output " + f"{stat_result.stdout.strip()!r}" + ) + continue + if file_size > MAX_BINARY_FILE_SIZE: logger.info( f"Skipping {file_path}: size {file_size} bytes "