From ff9c87bfc793306531673e5d6fdea39de25dfabf Mon Sep 17 00:00:00 2001 From: mptyl Date: Tue, 11 Aug 2026 19:58:28 +0200 Subject: [PATCH] chore: expose DWH preprocessing failure detail under P2 debug --- backend/scripts/p2-acceptance.mjs | 1 + harness/tht/cli/preprocess_cmd.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/scripts/p2-acceptance.mjs b/backend/scripts/p2-acceptance.mjs index 340267cf..d0613680 100644 --- a/backend/scripts/p2-acceptance.mjs +++ b/backend/scripts/p2-acceptance.mjs @@ -781,6 +781,7 @@ async function writeInstallationFiles(ctx) { image: ctx.coreImageTag, environment: { P2_CHILD_DEBUG: "1", + THT_P2_DEBUG: "1", THT_EVIDENCE_PRIVATE_HOST_ALLOWLIST: "host.docker.internal", }, extra_hosts: ["host.docker.internal:host-gateway"], diff --git a/harness/tht/cli/preprocess_cmd.py b/harness/tht/cli/preprocess_cmd.py index 3bd008c6..a716fa50 100644 --- a/harness/tht/cli/preprocess_cmd.py +++ b/harness/tht/cli/preprocess_cmd.py @@ -4,6 +4,7 @@ from __future__ import annotations import hashlib import json +import os import re from pathlib import Path @@ -259,8 +260,10 @@ def dwh_cmd( raise typer.Exit(code=2) try: result = run_dwh_from_config(config, steps=selected, resume=resume) - except Exception: # noqa: BLE001 + except Exception as exc: # noqa: BLE001 payload = {"status": "failed", "error": "DWH preprocessing failed"} + if os.environ.get("THT_P2_DEBUG") == "1": + payload["error"] = f"DWH preprocessing failed: {type(exc).__name__}: {exc}" if json_output: typer.echo(json.dumps(payload, sort_keys=True)) else: