17 lines
617 B
Python
17 lines
617 B
Python
#!/usr/bin/env python3
|
|
import paramiko
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("10.10.0.10", username="localadministrator", password="Bbt9115xty9176!", timeout=20)
|
|
_, o, e = c.exec_command(
|
|
"docker exec coolify-db psql -U coolify -d coolify -t -A -c "
|
|
"\"SELECT logs FROM application_deployment_queues WHERE id=1088;\""
|
|
)
|
|
text = o.read().decode()
|
|
# find error lines
|
|
for needle in ["Type error", "Failed to compile", "ERROR:", "error"]:
|
|
idx = text.rfind(needle)
|
|
if idx >= 0:
|
|
print(text[max(0, idx-500):idx+1500])
|
|
print("---")
|
|
c.close() |