veza/DEPANNAGE_RAPIDE.md

162 lines
3.4 KiB
Markdown

# 🔧 Dépannage Rapide - Veza Integration
## ✅ Problèmes Résolus
### 1. Migration SQL `050_data_validation_constraints.sql` ❌ → ✅
**Problème**: `syntax error at or near "NOT"` - PostgreSQL ne supporte pas `IF NOT EXISTS` avec `ADD CONSTRAINT`
**Solution**: Migration corrigée pour utiliser des blocs `DO $$` (comme dans `930_add_missing_foreign_keys.sql`)
**Status**: ✅ **CORRIGÉ**
---
### 2. Port Redis Occupé ❌ → ✅
**Problème**: `address already in use` sur port 6379
**Causes possibles**:
- Service Redis système actif (`systemctl status redis`)
- Container Docker Redis déjà en cours d'exécution
**Solutions**:
**Option A: Arrêter le service Redis système** (Recommandé)
```bash
# Vérifier si Redis système est actif
systemctl status redis
# Arrêter le service
sudo systemctl stop redis
# Optionnel: Désactiver au démarrage
sudo systemctl disable redis
```
**Option B: Arrêter le container Docker Redis**
```bash
# Arrêter l'instance existante
docker stop veza_redis
# Redémarrer via docker-compose
docker compose up -d redis
```
**Vérification**:
```bash
# Vérifier que le port est libre
ss -tlnp | grep 6379
# Vérifier les containers
docker compose ps
```
**Status**: ✅ **RÉSOLU**
---
## 🚀 Démarrage Rapide (Après Corrections)
### Option 1: Backend + Frontend Seulement (Recommandé pour tests)
```bash
# Terminal 1: Infrastructure
make infra-up
# Terminal 2: Backend
cd veza-backend-api
go run cmd/api/main.go
# Terminal 3: Frontend
cd apps/web
npm run dev
```
**URLs**:
- Frontend: http://localhost:3000
- Backend: http://localhost:8080
- Swagger: http://localhost:8080/docs
---
### Option 2: Tout-en-un (avec Makefile)
```bash
# Ignorer les erreurs Rust (non bloquant)
make dev 2>&1 | grep -v "libsqlite3-sys"
```
**Note**: Les erreurs Rust (chat-server, stream-server) ne bloquent pas l'intégration backend/frontend.
---
## ⚙️ Configuration Backend
Le fichier `.env` a été créé automatiquement dans `veza-backend-api/.env`:
```bash
APP_ENV=development
JWT_SECRET=dev-secret-key-minimum-32-characters-long-for-testing
DATABASE_URL=postgres://veza:password@localhost:5432/veza?sslmode=disable
REDIS_URL=redis://localhost:6379
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
APP_PORT=8080
LOG_LEVEL=INFO
```
---
## 🧪 Test Rapide
```bash
# 1. Vérifier infrastructure
docker compose ps
# 2. Vérifier backend
curl http://localhost:8080/health
# 3. Vérifier frontend
curl http://localhost:3000
# 4. Ouvrir dans navigateur
open http://localhost:3000
```
---
## 🐛 Problèmes Connus (Non Bloquants)
### Erreur Rust `libsqlite3-sys`
**Message**: `failed to select a version for libsqlite3-sys`
**Impact**: ⚠️ **NON BLOQUANT** - Les serveurs Rust (chat, stream) ne sont pas nécessaires pour tester l'intégration backend/frontend.
**Solution**: Ignorer cette erreur ou corriger les dépendances Rust séparément.
---
### Go Version (air)
**Message**: `requires go >= 1.25 (running go 1.24.10)`
**Impact**: ⚠️ **NON BLOQUANT** - Le backend démarre avec `go run` même sans `air`.
**Solution**: Utiliser `go run cmd/api/main.go` au lieu de `air`.
---
## ✅ Checklist Avant Test
- [x] Migration SQL corrigée
- [x] Redis démarré
- [x] Backend `.env` configuré
- [ ] Backend démarré (port 8080)
- [ ] Frontend démarré (port 3000)
- [ ] Test dans navigateur
---
**Guide complet**: Voir `GUIDE_DEMARRAGE_INTEGRATION.md`