Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions edera-debug-report
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ def which(cmd: str) -> Optional[str]:
return shutil.which(cmd)


_protect_cli: Optional[str] = None
_protect_cli_resolved = False


def which_protect() -> Optional[str]:
"""Resolve the Edera CLI, memoized. Full retail installs ship it as
`protect`; dev machines typically have `protect-ctl`. Same tool."""
global _protect_cli, _protect_cli_resolved
if not _protect_cli_resolved:
_protect_cli = which("protect") or which("protect-ctl")
_protect_cli_resolved = True
return _protect_cli


def _progress(msg: str) -> None:
"""Single-line progress to stderr. When something hangs, the last line
printed identifies the offending command."""
Expand Down Expand Up @@ -917,9 +931,11 @@ def collect_protect_zone_logs(
`{top_name}/protect/`. Should run before journal collection so the journal
capture includes any activity from these calls.
"""
protect_ctl = which("protect-ctl")
protect_ctl = which_protect()
if not protect_ctl:
log.append("INFO: protect-ctl not found; skipping protect zone log collection")
log.append(
"INFO: protect/protect-ctl not found; skipping protect zone log collection"
)
return

arc_dir = f"{top_name}/protect"
Expand Down Expand Up @@ -1067,12 +1083,21 @@ def collect_all(
# because they're very directly relevant to debugging Edera Protect
# problems.
services = [
# Edera services, current shipping daemons
"kube-spdy-proxy.service",
"protect-cri.service",
"protect-daemon.service",
"protect-gpu-scrub.service",
"protect-meminfo.service",
"protect-monitor.service",
"protect-network.service",
"protect-orchestrator.service",
"protect-preinit.service",
"protect-storage.service",
"xenstored.service",
# Edera services, deprecated but may still be present on older
# hosts
"protect-orchestrator.service",
# Non-Edera services, specific to Kubernetes
"containerd.service",
"kubelet.service",
]
Expand Down Expand Up @@ -1132,7 +1157,7 @@ def collect_all(
log, aw, f"{top_name}/xl_info.txt", [xl_bin, "info"], timeout_s=30.0
)
else:
prot = which("protect")
prot = which_protect()
if prot:
run_and_write(
log,
Expand All @@ -1148,6 +1173,13 @@ def collect_all(
[prot, "host", "hv-debug-info"],
timeout_s=30.0,
)
run_and_write(
log,
aw,
f"{top_name}/hv_zone_details.txt",
[prot, "host", "hv-zone-details", "-o", "json"],
timeout_s=30.0,
)
else:
log.append(
"FAIL: Neither 'xl' nor 'protect' found for Xen dom0 collection."
Expand Down
Loading