fix: verify container actually running after start, show logs on failure
This commit is contained in:
parent
678fa83f31
commit
c2bfffa668
1 changed files with 10 additions and 2 deletions
|
|
@ -109,8 +109,16 @@ server {{
|
|||
|
||||
print(f"[{name}] Starting...")
|
||||
r = run(f"bash {start_path}", timeout=30)
|
||||
if r.returncode != 0:
|
||||
print(f"❌ {name}: {r.stderr}")
|
||||
if r.returncode != 0 or "Error" in r.stderr or "Error" in r.stdout:
|
||||
print(f"❌ {name}: {r.stderr or r.stdout}")
|
||||
return False
|
||||
|
||||
# Verify container is running
|
||||
time.sleep(2)
|
||||
check = run(f"docker inspect -f '{{{{.State.Running}}}}' {container} 2>/dev/null")
|
||||
if check.stdout.strip() != "true":
|
||||
logs = run(f"docker logs {container} 2>&1").stdout[-500:]
|
||||
print(f"❌ {name} failed to start:\n{logs}")
|
||||
return False
|
||||
|
||||
# Save state
|
||||
|
|
|
|||
Loading…
Reference in a new issue