The deploy workflow was writing PORT=3800 and ZY_SITE_MODE=production
into .env.app, which gets loaded by ecosystem.config.js's loadEnvFile().
Since ...appEnv is spread first and instance-specific values override it,
this is now safe — but removing them from .env.app eliminates the root
cause entirely (belt-and-suspenders fix).
Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/80f409c9-7f98-443e-9c31-21111194a523
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
Root causes found:
1. CN server (www.guanghulab.com): conflicting Nginx configs in sites-enabled
and conf.d override cn-domain.conf, causing requests to proxy to a non-
responsive backend → 502
2. SG server: ecosystem.config.js spreads .env.app AFTER PORT/ZY_SITE_MODE,
causing .env.app's PORT=3800 to override preview's PORT=3801 → both
instances fight for port 3800 → preview fails → 502 on preview domain
Fixes:
- deploy-cn-landing.yml: clean ALL conflicting Nginx site configs from both
sites-enabled and conf.d before installing cn-domain.conf
- deploy-cn-landing.yml: enhanced health check diagnostics to detect config
conflicts and validate correct service identity
- ecosystem.config.js: move ...appEnv BEFORE instance-specific PORT and
ZY_SITE_MODE to ensure PM2 config takes priority over .env.app
Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/80f409c9-7f98-443e-9c31-21111194a523
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
Root cause: deploy workflow only deleted zhuyuan-server before PM2 restart,
leaving zhuyuan-preview in errored state. Since guanghulab.online is the
preview domain (Nginx §2 → port 3801), requests to /api/* got 502.
Fix: delete BOTH zhuyuan-server AND zhuyuan-preview before pm2 start.
Add health check for port 3801 to detect this failure in future deploys.
Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/04495ae8-6c76-4458-bbb0-262e3205dccd
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
- Fail fast on startup if ZY_CN_RELAY_API_KEY is not configured
- Add model endpoint context to error messages for debugging
- Make API timeout configurable via environment variable
- Deduplicate health check curl in workflow
- Add security note about VPN-encrypted relay channel
Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/f6db708e-8b10-4339-b48f-db5f111ae5cd
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
The rsync `-e "ssh -F ~/.ssh/config"` fails because `~` inside double
quotes is not expanded by bash. rsync passes the literal `~/.ssh/config`
to ssh, which cannot resolve it. Removing `-e` lets rsync use the default
ssh, which reads `$HOME/.ssh/config` automatically.
Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/45d1241e-8f50-40ac-898d-54e2a92b3300
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>