Files
microdao-daarion/docs/DEPLOY_NODE1_REPAIR.md
Apple a6e531a098 fix: NODE1_REPAIR - healthchecks, dependencies, SSR env, telegram gateway
TASK_PHASE_NODE1_REPAIR:
- Fix daarion-web SSR: use CITY_API_BASE_URL instead of 127.0.0.1
- Fix auth API routes: use AUTH_API_URL env var
- Add wget to Dockerfiles for healthchecks (stt, ocr, web-search, swapper, vector-db, rag)
- Update healthchecks to use wget instead of curl
- Fix vector-db-service: update torch==2.4.0, sentence-transformers==2.6.1
- Fix rag-service: correct haystack imports for v2.x
- Fix telegram-gateway: remove msg.ack() for non-JetStream NATS
- Add /health endpoint to nginx mvp-routes.conf
- Add room_role, is_public, sort_order columns to city_rooms migration
- Add TASK_PHASE_NODE1_REPAIR.md and DEPLOY_NODE1_REPAIR.md docs

Previous tasks included:
- TASK 039-044: Orchestrator rooms, Matrix chat cleanup, CrewAI integration
2025-11-29 05:17:08 -08:00

174 lines
3.3 KiB
Markdown

# DEPLOY_NODE1_REPAIR.md
Quick deploy guide to bring NODE1 (144.76.224.179) back to a healthy, MVP-ready state.
---
## Prerequisites
- SSH access to NODE1: `ssh root@144.76.224.179`
- All code changes from `TASK_PHASE_NODE1_REPAIR.md` committed and pushed to `main` branch.
---
## Step 1: Update code on NODE1
```bash
ssh root@144.76.224.179
cd /opt/microdao-daarion
git fetch origin
git checkout main
git pull origin main
```
---
## Step 2: Apply database migrations
```bash
# Option A: If there's a migrate script
./scripts/migrate-prod.sh
# Option B: Manual migration via city-service
docker compose exec daarion-city-service python -c "from migrations import run_migrations; import asyncio; asyncio.run(run_migrations())"
```
---
## Step 3: Rebuild affected services
```bash
docker compose build \
daarion-city-service \
daarion-web \
dagi-router \
dagi-stt-service \
dagi-ocr-service \
dagi-web-search-service \
dagi-swapper-service \
dagi-vector-db-service \
dagi-rag-service \
telegram-gateway
```
---
## Step 4: Restart services
```bash
docker compose up -d \
daarion-city-service \
daarion-web \
dagi-router \
dagi-stt-service \
dagi-ocr-service \
dagi-web-search-service \
dagi-swapper-service \
dagi-vector-db-service \
dagi-rag-service \
telegram-gateway
```
---
## Step 5: Verify health
```bash
# Check all containers are running and healthy
docker ps --format "table {{.Names}}\t{{.Status}}"
# Individual health checks
curl -s http://localhost:7001/health # city-service
curl -s http://localhost:9102/health # dagi-router
curl -s http://localhost:9300/health # gateway
curl -s http://localhost:8890/health # swapper
```
Expected: all return `{"status":"ok"}` or similar.
---
## Step 6: Verify UI
Open in browser:
- `http://144.76.224.179:3000/microdao/daarion` — MicroDAO page
- `http://144.76.224.179:3000/nodes/node-1` — NODE1 cabinet
- `http://144.76.224.179:3000/agents` — Agents list
All pages should load without SSR errors.
---
## Step 7: Verify Telegram bot
1. Send a message to `@DAARWIZZBot` in Telegram.
2. Check logs:
```bash
docker logs --tail 50 telegram-gateway
```
3. Verify no `Temporary failure in name resolution` or `NotJSMessageError`.
4. Bot should respond with LLM-generated reply.
---
## Step 8: Verify external health endpoint
```bash
curl -k https://gateway.daarion.city/health
```
Expected: HTTP 200 with `OK` or `{"status":"ok"}`.
---
## Rollback (if needed)
```bash
# Revert to previous commit
git checkout HEAD~1
# Rebuild and restart
docker compose build <service>
docker compose up -d <service>
```
---
## Troubleshooting
### daarion-web shows `ECONNREFUSED 127.0.0.1:80`
Check `.env` or `docker-compose.yml` for `daarion-web`:
```env
CITY_API_BASE_URL=http://daarion-city-service:7001
```
### Service marked `unhealthy` but actually works
Check healthcheck command in `docker-compose.yml`. Ensure `wget` or `curl` is installed in the image:
```dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends wget && rm -rf /var/lib/apt/lists/*
```
### telegram-gateway can't resolve `router`
Set correct env var:
```yaml
environment:
ROUTER_URL: http://dagi-router:9102
```
Or add network alias to `dagi-router`:
```yaml
networks:
default:
aliases:
- router
```
---
**Last updated:** 2025-11-29