@@ -353,29 +353,43 @@ def gzip_then_base64_encode(s: str) -> str:
353
353
354
354
def is_healthy (ssh ) -> bool :
355
355
health_checks = [
356
- ("postgres" , "sudo -u postgres /usr/bin/pg_isready -U postgres" ),
356
+ (
357
+ "postgres" ,
358
+ "sudo -u postgres /usr/bin/pg_isready -U postgres" ,
359
+ "journalctl -b -u postgres -n 10 -r --no-pager" ,
360
+ ),
357
361
(
358
362
"adminapi" ,
359
363
f"curl -sf -k --connect-timeout 30 --max-time 60 https://localhost:8085/health -H 'apikey: { supabase_admin_key } '" ,
364
+ "journalctl -b -u adminapi -n 10 -r --no-pager" ,
360
365
),
361
366
(
362
367
"postgrest" ,
363
368
"curl -sf --connect-timeout 30 --max-time 60 http://localhost:3001/ready" ,
369
+ "journalctl -b -u postgrest -n 10 -r --no-pager" ,
364
370
),
365
371
(
366
372
"gotrue" ,
367
373
"curl -sf --connect-timeout 30 --max-time 60 http://localhost:8081/health" ,
374
+ "journalctl -b -u gotrue -n 10 -r --no-pager" ,
368
375
),
369
- ("kong" , "sudo kong health" ),
370
- ("fail2ban" , "sudo fail2ban-client status" ),
376
+ ("kong" , "sudo kong health" , "" ),
377
+ ("fail2ban" , "sudo fail2ban-client status" , "" ),
371
378
]
372
379
373
- for service , command in health_checks :
380
+ for service , command , info_command in health_checks :
374
381
try :
375
382
result = run_ssh_command (ssh , command )
376
- if not result ["succeeded" ]:
377
- logger .warning (f"{ service } not ready" )
378
- return False
383
+ if result ["succeeded" ]:
384
+ continue
385
+
386
+ info_text = ""
387
+ if info_command is not "" :
388
+ info_result = run_ssh_command (ssh , info_command )
389
+ if info_result ["succeeded" ]:
390
+ info_text = info_result ["stdout" ].strip ()
391
+ logger .warning (f"{ service } not ready{ info_text } " )
392
+ return False
379
393
except Exception :
380
394
logger .warning (f"Connection failed during { service } check" )
381
395
return False
0 commit comments