diff --git a/tenant-service/src/main/java/com/xuqm/tenant/service/SystemUpdateService.java b/tenant-service/src/main/java/com/xuqm/tenant/service/SystemUpdateService.java index 4cb632e..54e7ed6 100644 --- a/tenant-service/src/main/java/com/xuqm/tenant/service/SystemUpdateService.java +++ b/tenant-service/src/main/java/com/xuqm/tenant/service/SystemUpdateService.java @@ -801,6 +801,17 @@ public class SystemUpdateService { "up", "-d", "--no-deps", "--force-recreate", svc); // 拿到 compose up 之后最新创建的容器 ID,排除旧容器干扰 String newContainerId = getNewestContainerId(svc); + emit.accept(" [debug] " + svc + " newContainerId=" + newContainerId); + // Log all containers visible for this service label + try { + Process dbgPs = new ProcessBuilder("docker", "ps", "-a", + "--filter", "label=com.docker.compose.service=" + svc, + "--format", "{{.ID}} {{.Names}} {{.Status}} {{.CreatedAt}}") + .redirectErrorStream(true).start(); + String dbgOut = new String(dbgPs.getInputStream().readAllBytes(), StandardCharsets.UTF_8).trim(); + dbgPs.waitFor(); + for (String l : dbgOut.split("\n")) { if (!l.isBlank()) emit.accept(" [debug] " + l); } + } catch (Exception ignored) {} boolean healthy = waitForServiceStable(emit, svc, newContainerId, HEALTH_CHECK_TIMEOUT_SEC); if (healthy) { @@ -943,6 +954,7 @@ public class SystemUpdateService { ).redirectErrorStream(true).start(); statusLine = new String(ins.getInputStream().readAllBytes(), StandardCharsets.UTF_8).trim(); ins.waitFor(); + emit.accept(" [debug] " + service + " t=" + elapsed + "s inspect " + containerId + " → " + statusLine); } else { // 退化模式:查 running 容器 Process runPs = new ProcessBuilder(