All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 4s
- Updated the .env loading process to first check for an explicit path, improving reliability in different working directories. - Added logging for successful .env loading and fallback mechanisms. - Enhanced EdgeDTO creation with robust error handling, including fallbacks for unsupported provenance values and logging of errors for better traceability.
3.8 KiB
3.8 KiB
Deployment-Checkliste: Prod vs. Dev Retrieval-Problem
Datum: 2026-01-12
Version: v4.5.10
Status: 🔴 Kritisch
Problem
Prod-System findet keine Suchergebnisse, während Dev-System korrekt funktioniert. Identischer Code, identische Daten.
Identifizierte Ursachen
1. 🔴 KRITISCH: Alte EdgeDTO-Version in Prod
Symptom:
ERROR: 1 validation error for EdgeDTO
provenance
Input should be 'explicit', 'rule', 'smart' or 'structure'
[type=literal_error, input_value='explicit:callout', input_type=str]
Ursache:
- Prod verwendet eine alte Version des
EdgeDTO-Modells ausapp/models/dto.py - Die alte Version unterstützt nur:
"explicit", "rule", "smart", "structure" - Die neue Version (v4.5.3+) unterstützt:
"explicit:callout", "explicit:wikilink", "explicit:note_zone", ...
Lösung:
- ✅ Code in
dto.pyist bereits korrekt (Zeile 51-56) - ⚠️ Prod muss neu gestartet werden, um die neue Version zu laden
- ⚠️ Python-Modul-Cache leeren falls nötig:
find . -type d -name __pycache__ -exec rm -r {} +
2. ✅ Collection-Präfix korrekt
- Prod:
COLLECTION_PREFIX=mindnet→mindnet_chunks✅ - Dev:
COLLECTION_PREFIX=mindnet_dev→mindnet_dev_chunks✅ - Kein Problem hier
Sofortmaßnahmen
Schritt 1: Code-Verifikation in Prod
# In Prod-System
cd /path/to/mindnet
grep -A 10 "provenance.*Literal" app/models/dto.py
Erwartete Ausgabe:
provenance: Optional[Literal[
"explicit", "rule", "smart", "structure",
"explicit:callout", "explicit:wikilink", "explicit:note_zone", ...
]] = "explicit"
Falls nicht vorhanden: Code ist nicht aktualisiert → Deployment erforderlich
Schritt 2: Python-Cache leeren
# In Prod-System
find . -type d -name __pycache__ -exec rm -r {} +
find . -name "*.pyc" -delete
Schritt 3: Service neu starten
# FastAPI/uvicorn neu starten
# Oder Docker-Container neu starten
Schritt 4: Verifikation
-
Test-Query ausführen:
curl -X POST http://localhost:8001/api/chat \ -H "Content-Type: application/json" \ -d '{"message": "Was für einen Status hat das Projekt mindnet?"}' -
Log prüfen:
- ✅ Keine
validation error for EdgeDTOmehr - ✅
✨ [SUCCESS] Stream 'facts_stream' lieferte X Treffer. - ✅ Ergebnisse werden zurückgegeben
- ✅ Keine
Code-Vergleich
Aktuelle Version (sollte in Prod sein):
# app/models/dto.py (Zeile 51-56)
provenance: Optional[Literal[
"explicit", "rule", "smart", "structure",
"explicit:callout", "explicit:wikilink", "explicit:note_zone", "explicit:note_scope",
"inline:rel", "callout:edge", "semantic_ai", "structure:belongs_to", "structure:order",
"derived:backlink", "edge_defaults", "global_pool"
]] = "explicit"
Alte Version (verursacht Fehler):
# Alte Version (nur 4 Werte)
provenance: Optional[Literal[
"explicit", "rule", "smart", "structure"
]] = "explicit"
Weitere mögliche Ursachen (wenn Fix nicht hilft)
1. Unterschiedliche Python-Versionen
- Prüfen:
python --versionin Dev vs. Prod - Pydantic-Verhalten kann zwischen Versionen variieren
2. Unterschiedliche Pydantic-Versionen
- Prüfen:
pip list | grep pydanticin Dev vs. Prod requirements.txtsollte identisch sein
3. Unterschiedliche Embedding-Modelle
- Prüfen:
MINDNET_EMBEDDING_MODELin beiden Systemen - Beide verwenden:
nomic-embed-text✅
4. Unterschiedliche Vektor-Dimensionen
- Prüfen:
VECTOR_DIMin beiden Systemen - Beide verwenden:
768✅
Erwartetes Ergebnis nach Fix
- ✅ Keine Pydantic-Validierungsfehler mehr
- ✅ Alle Streams liefern Ergebnisse
- ✅ Retrieval funktioniert identisch in Dev und Prod
- ✅
explicit:calloutProvenance wird korrekt akzeptiert