Skip to content

fix: auto-heal ERR_CONNECTION_REFUSED on zeusai.pro#160

Merged
ruffy80 merged 2 commits into
mainfrom
copilot/debug-connection-refusal
Apr 13, 2026
Merged

fix: auto-heal ERR_CONNECTION_REFUSED on zeusai.pro#160
ruffy80 merged 2 commits into
mainfrom
copilot/debug-connection-refusal

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

zeusai.pro returns ERR_CONNECTION_REFUSED when Nginx is down — the only recovery path was the keepalive workflow running every 30 minutes, and no mechanism watched Nginx specifically (health-guardian only probed :3000 directly, bypassing Nginx entirely).

Changes

health-guardian.js — Nginx watchdog

  • Added checkNginx() polling http://127.0.0.1:80/ every 60s
  • Added healNginx() that runs nginx -t && systemctl reload nginx || systemctl restart nginx || service nginx restart on 3 consecutive failures
  • Previously the PM2 guardian could report healthy while Nginx was dead and users got ERR_CONNECTION_REFUSED

unicorn-keepalive.yml — frequency + server cron bootstrap

  • Cron: */30*/5 (max 5-min external detection window for complete server failures)
  • On successful SSH restart, installs /etc/cron.d/unicorn-self-heal if not present — runs fix-server.sh every 5 min on the server itself, independent of GitHub CI

vercel-deploy.yml — cron install on every deploy

  • Every full deploy now writes/overwrites /etc/cron.d/unicorn-self-heal, ensuring the server-side healer is always current

Recovery layers after these changes

Layer Mechanism Trigger interval Scope
1 unicorn-health-guardian (PM2) 60s Nginx + Node.js
2 /etc/cron.d/unicorn-self-heal 5 min Nginx + UFW + PM2 + SSL
3 unicorn-keepalive.yml (GH Actions) 5 min Full remote SSH heal + redeploy

Copilot AI and others added 2 commits April 13, 2026 21:31
…atchdog, server cron, faster deploy

Agent-Logs-Url: https://github.com/ruffy80/ZeusAI/sessions/f66ac24f-d661-401f-ad82-a02b095d6f10

Co-authored-by: ruffy80 <29306714+ruffy80@users.noreply.github.com>
…ression in nginx heal

Agent-Logs-Url: https://github.com/ruffy80/ZeusAI/sessions/f66ac24f-d661-401f-ad82-a02b095d6f10

Co-authored-by: ruffy80 <29306714+ruffy80@users.noreply.github.com>
@vercel

vercel Bot commented Apr 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zeusai Ready Ready Preview, Comment Apr 13, 2026 9:37pm

Request Review

@ruffy80 ruffy80 marked this pull request as ready for review April 13, 2026 21:37
@ruffy80 ruffy80 merged commit 25a068d into main Apr 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants