Created
May 10, 2026 21:07
-
-
Save koliadych/ccd4a1acd0250d7cb93043619c04212d to your computer and use it in GitHub Desktop.
fintechner runtime reload diagnostic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| export AWS_PAGER="" | |
| REGION=ap-northeast-1 | |
| INSTANCE_ID=i-089ad4a6b76132ba2 | |
| CMD_ID=$(aws --region "$REGION" ssm send-command \ | |
| --instance-ids "$INSTANCE_ID" \ | |
| --document-name AWS-RunShellScript \ | |
| --parameters '{"commands":[ | |
| "echo === connector service ===", | |
| "sudo systemctl is-active fintechner-connector", | |
| "echo === port 8080 ===", | |
| "sudo ss -tlnp | grep :8080 || echo no-listener-8080", | |
| "echo === connector journal last 120 ===", | |
| "sudo journalctl -u fintechner-connector -n 120 --no-pager", | |
| "echo === active env in DB ===", | |
| "sudo docker exec timescale psql -U fintechner -d fintechner -c \"SELECT * FROM active_env;\" 2>&1 | head -10", | |
| "echo === hl_credentials count ===", | |
| "sudo docker exec timescale psql -U fintechner -d fintechner -c \"SELECT id, env, account_addr, instruments, created_at FROM hl_credentials;\" 2>&1 | head -20", | |
| "echo === curl localhost:8080/healthz ===", | |
| "curl -sS -o /dev/null -w \"http=%{http_code}\\n\" http://localhost:8080/healthz || true", | |
| "curl -sS -o /dev/null -w \"http=%{http_code}\\n\" http://localhost:8080/admin/runtime/status || true" | |
| ]}' \ | |
| --query Command.CommandId --output text) | |
| for i in $(seq 1 25); do | |
| sleep 4 | |
| STATUS=$(aws --region "$REGION" ssm get-command-invocation --command-id "$CMD_ID" --instance-id "$INSTANCE_ID" --query Status --output text 2>/dev/null || echo Pending) | |
| case "$STATUS" in Success|Failed|Cancelled|TimedOut) echo " $STATUS"; break ;; *) echo " $STATUS";; esac | |
| done | |
| echo | |
| echo "=== STDOUT ===" | |
| aws --region "$REGION" ssm get-command-invocation --command-id "$CMD_ID" --instance-id "$INSTANCE_ID" --query StandardOutputContent --output text | |
| echo | |
| echo "=== STDERR ===" | |
| aws --region "$REGION" ssm get-command-invocation --command-id "$CMD_ID" --instance-id "$INSTANCE_ID" --query StandardErrorContent --output text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment