From 4447905864aeef3ae87178dd6ee3808054652acd Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 10 Jun 2026 12:47:16 -0500 Subject: [PATCH] workers: don't re-upload handler-returned MinIO keys as local files handle_process_compliance_service assumed handlers return local temp paths and re-uploaded each to MinIO. The MCS-150 handler uploads itself and returns the MinIO key, so the re-upload tried to read a nonexistent local file and logged a 'File not found' error after the order was already correctly held at the admin gate. Now we skip files that don't exist locally and keep the returned key as-is. --- scripts/workers/job_server.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/workers/job_server.py b/scripts/workers/job_server.py index 10357c6..90abda3 100644 --- a/scripts/workers/job_server.py +++ b/scripts/workers/job_server.py @@ -1265,6 +1265,13 @@ def handle_process_compliance_service(payload: dict) -> dict: for fp in file_paths: from pathlib import Path p = Path(fp) + # Some handlers (e.g. MCS-150) upload to MinIO themselves and return the + # resulting MinIO key rather than a local temp path. Those keys do not + # exist on the local filesystem -- treat them as already-stored and keep + # the key as-is instead of trying to re-upload a nonexistent local file. + if not p.exists(): + minio_paths.append(fp) + continue remote = f"compliance/{effective_order_number}/{p.name}" storage.upload(fp, remote) minio_paths.append(remote)