33800 Docs

← Retour

Proposition : Fix 3 problemes AI jobs

Date : 30/01/2026 Status : IMPLEMENTEE Scope : ai-orchestrator + whisper-api Impact : Tous les jobs AI sauf ollama sont affectes


Probleme 1 : Bug PostgreSQL JSON sur creation de jobs

Symptome : POST /api/jobs retourne 500 pour certains payloads Erreur : asyncpg.exceptions.InvalidTextRepresentationError: invalid input syntax for type json Localisation : ai-orchestrator/app/main.py:942-945, fonction db_create_job

Cause : json.dumps(job_data.input_params) peut produire du JSON invalide pour PostgreSQL si input_params contient des valeurs problematiques (bytes, objets non-serialisables).

Fix propose :

Fichier : ai-orchestrator/app/main.py, ligne 942-945

Avant :

async def db_create_job(job_data: JobCreate) -> str:
    """Create a new job in PostgreSQL"""
    job_id = str(uuid.uuid4())
    async with pg_pool.acquire() as conn:
        await conn.execute("""
            INSERT INTO ai_jobs (id, tool_id, job_type, input_params, priority, status, callback_url)
            VALUES ($1, $2, $3, $4, $5, 'pending', $6)
        """, job_id, job_data.tool_id, job_data.job_type, json.dumps(job_data.input_params), job_data.priority, job_data.callback_url)
    return job_id

Apres :

async def db_create_job(job_data: JobCreate) -> str:
    """Create a new job in PostgreSQL"""
    job_id = str(uuid.uuid4())
    try:
        params_json = json.dumps(job_data.input_params, default=str)
    except (TypeError, ValueError) as e:
        logger.error(f"Failed to serialize input_params: {e}")
        params_json = json.dumps({"_raw": str(job_data.input_params)})
    async with pg_pool.acquire() as conn:
        await conn.execute("""
            INSERT INTO ai_jobs (id, tool_id, job_type, input_params, priority, status, callback_url)
            VALUES ($1, $2, $3, $4::json, $5, 'pending', $6)
        """, job_id, job_data.tool_id, job_data.job_type, params_json, job_data.priority, job_data.callback_url)
    return job_id

Changements :


Probleme 2 : Outils GPU win11 ne demarrent pas

Symptome : fooocus, comfyui, wan21 echouent avec "Failed to start tool" ou "timed out" Cause : Les .bat sur I:\ de win11 ne se lancent pas via schtasks depuis SSH

Action : Verification manuelle necessaire sur win11 (pas un fix code)

  1. Se connecter au bureau de win11
  2. Verifier que le disque I:\ est monte
  3. Verifier nvidia-smi (GPU accessible)
  4. Tester manuellement :
    • I:\ComfyUI_clean\start_comfyui.bat → doit ecouter sur :8188
    • I:\Fooocus-API\start_fooocus_api.bat → doit ecouter sur :7865
    • I:\Wan2.1\start_wan.bat → doit ecouter sur :7860
  5. Si les .bat fonctionnent manuellement mais pas via schtasks, verifier les taches planifiees dans Task Scheduler

Pas de modification de code pour ce point - c'est un probleme d'environnement win11.


Probleme 3 : whisper-api isole du reseau

Symptome : urllib.error.URLError: Network is unreachable quand whisper telecharge un modele Cause : Le compose whisper-api/docker-compose.yml ne declare aucun reseau, le container est isole

Fix propose :

Fichier : /stock_8to/33800-stack/docker/stacks/whisper-api/docker-compose.yml

Avant :

services:
  whisper-api:
    image: registry.33800.nowhere84.com/gouroubleu/whisper-api:latest
    restart: unless-stopped

Apres :

services:
  whisper-api:
    image: registry.33800.nowhere84.com/gouroubleu/whisper-api:latest
    restart: unless-stopped
    networks:
      - ai-services
      - default

networks:
  ai-services:
    external: true
    name: ai-services

Cela connecte whisper au reseau ai-services partage (acces aux autres containers) tout en gardant le reseau default pour l'acces internet.

Alternative : Si le modele base.pt est deja en cache dans /stock_8to/33800-stack/ai-data/whisper/, on peut monter ce volume pour eviter tout telechargement :

services:
  whisper-api:
    image: registry.33800.nowhere84.com/gouroubleu/whisper-api:latest
    restart: unless-stopped
    volumes:
      - /stock_8to/33800-stack/ai-data/whisper:/root/.cache/whisper

Ordre d'execution propose

  1. Fix #1 (PostgreSQL JSON) - fix code, git push, redeploy orchestrator
  2. Fix #3 (whisper network) - modifier compose, redeploy whisper
  3. Fix #2 (win11) - verification manuelle sur le bureau Windows

Fichiers modifies

Fichier Action
ai-orchestrator/app/main.py MODIFIER - fix db_create_job
docker/stacks/whisper-api/docker-compose.yml MODIFIER - ajouter reseau + volume
win11 VERIF MANUELLE - pas de code