# 🔧 Guide de dĂ©pannage rapide ## ProblĂšme : 404 sur l'interface web ### Cause Le serveur HTTP dĂ©marre mais ne trouve pas `index.html` ### Solution ```bash # 1. ArrĂȘter tout bash stop.sh # 2. VĂ©rifier la structure des fichiers cd /mnt/e/My\ IA # Ou ton chemin ls -la ls -la frontend/ # 3. Tu DOIS voir : # frontend/ # └── index.html # 4. Si index.html manque, tĂ©lĂ©charge Ă  nouveau l'archive # 5. Lancer correctement bash start.sh # 6. Ouvrir # http://localhost:9000 ``` ## ProblĂšme : Permission denied avec source ### Cause Utilisation de `sh` au lieu de `bash` ### Solution ```bash # ❌ PAS COMME ÇA : sh start.sh # ✅ COMME ÇA : bash start.sh # Ou directement : ./start.sh ``` ## ProblĂšme : Backend ne dĂ©marre pas ### Diagnostic ```bash # Voir les logs cat /tmp/fastapi.log # VĂ©rifier Python python3 --version # Doit ĂȘtre 3.10+ # VĂ©rifier le port 8000 lsof -i :8000 ``` ### Solution ```bash # Si le port est occupĂ© kill $(lsof -t -i :8000) # Relancer cd /mnt/e/My\ IA/backend . venv/bin/activate python main.py ``` ## ProblĂšme : Ollama non accessible ### Diagnostic ```bash curl http://localhost:11434/api/tags ``` ### Solution ```bash # DĂ©marrer Ollama ollama serve & # Attendre 3 secondes sleep 3 # VĂ©rifier ollama list ``` ## Lancement manuel complet (si scripts ne marchent pas) ```bash # 1. Aller dans le dossier cd /mnt/e/My\ IA # 2. Terminal 1 : Ollama ollama serve # 3. Terminal 2 : Backend cd backend python3 -m venv venv . venv/bin/activate pip install -r requirements.txt python main.py # 4. Terminal 3 : Frontend cd frontend python3 -m http.server 9000 # 5. Ouvrir navigateur # http://localhost:9000 ``` ## VĂ©rification complĂšte ```bash # VĂ©rifier tous les services echo "=== Ollama ===" curl -s http://localhost:11434/api/tags | head -5 echo -e "\n=== Backend ===" curl -s http://localhost:9001/health echo -e "\n=== Frontend ===" curl -s http://localhost:9000 | head -5 echo -e "\n=== Processus ===" ps aux | grep -E "ollama|python|http.server" | grep -v grep ``` ## Checklist de debug - [ ] Ollama installĂ© : `which ollama` - [ ] Python 3.10+ : `python3 --version` - [ ] Structure correcte : `ls -la frontend/index.html` - [ ] Scripts exĂ©cutables : `ls -la *.sh` - [ ] Ports libres : `netstat -tlnp | grep -E "9001|9000"` - [ ] Logs accessibles : `cat /tmp/fastapi.log` ## RĂ©installation propre ```bash # 1. Tout arrĂȘter bash stop.sh pkill ollama pkill python # 2. Nettoyer rm -rf backend/venv rm /tmp/*.log rm /tmp/ai-assistant-*.pid # 3. RetĂ©lĂ©charger l'archive # (tĂ©lĂ©charger ai-code-assistant.zip) # 4. Extraire unzip -o ai-code-assistant.zip cd ai-code-assistant # 5. Rendre exĂ©cutable chmod +x start.sh stop.sh # 6. DĂ©marrer bash start.sh ``` ## Astuce : VĂ©rifier que tout fonctionne ```bash # Ce script vĂ©rifie tout en une commande cat > check.sh << 'EOF' #!/bin/bash echo "🔍 VĂ©rification systĂšme..." echo "" echo "1. Ollama:" if curl -s http://localhost:11434/api/tags > /dev/null 2>&1; then echo " ✅ Actif" else echo " ❌ Inactif" fi echo "2. Backend (port 8000):" if curl -s http://localhost:9001/health > /dev/null 2>&1; then echo " ✅ Actif" else echo " ❌ Inactif" fi echo "3. Frontend (port 9000):" if curl -s http://localhost:9000 > /dev/null 2>&1; then echo " ✅ Actif" else echo " ❌ Inactif" fi echo "4. Fichiers:" if [ -f "frontend/index.html" ]; then echo " ✅ index.html prĂ©sent" else echo " ❌ index.html manquant" fi echo "" echo "URL Ă  ouvrir: http://localhost:9000" EOF chmod +x check.sh bash check.sh ``` ## Contact / Support Si rien ne fonctionne : 1. Copie la sortie de : ```bash bash check.sh cat /tmp/fastapi.log cat /tmp/frontend.log ``` 2. VĂ©rifie ta structure de fichiers : ```bash tree -L 2 # ou find . -type f ``` 3. Partage ces informations pour obtenir de l'aide