jamiepine/voicebox · error · ValueError

Preset profile {profile_id} only supports engine '{profile.p

Error message

Preset profile {profile_id} only supports engine '{profile.preset_engine}', not '{engine}'

What it means

Raised in the preset branch of create_voice_prompt_from_profile() when the requested engine argument differs from the profile's preset_engine. Preset voices are bound to one specific engine at creation time (e.g. a 'qwen' preset voice id is not valid for a 'chatterbox' backend), so the engine parameter must agree with profile.preset_engine.

Source

Thrown at backend/services/profiles.py:552

    Returns:
        Voice prompt dictionary
    """
    from ..backends import get_tts_backend_for_engine

    profile = db.query(DBVoiceProfile).filter_by(id=profile_id).first()
    if not profile:
        raise ValueError(f"Profile not found: {profile_id}")

    voice_type = getattr(profile, "voice_type", None) or "cloned"
    validate_profile_engine(profile, engine)

    # ── Preset profiles: return engine-specific voice reference ──
    if voice_type == "preset":
        if not profile.preset_engine or not profile.preset_voice_id:
            raise ValueError(f"Preset profile {profile_id} is missing preset engine metadata")
        if profile.preset_engine != engine:
            raise ValueError(
                f"Preset profile {profile_id} only supports engine '{profile.preset_engine}', not '{engine}'"
            )
        return {
            "voice_type": "preset",
            "preset_engine": profile.preset_engine,
            "preset_voice_id": profile.preset_voice_id,
        }

    # ── Designed profiles: return text description (future) ──
    if voice_type == "designed":
        if not profile.design_prompt or not profile.design_prompt.strip():
            raise ValueError(f"Designed profile {profile_id} is missing design_prompt")
        return {
            "voice_type": "designed",
            "design_prompt": profile.design_prompt,
        }

    if engine not in CLONING_ENGINES:

View on GitHub (pinned to 51f49dea19)

Solutions

  1. Pass engine=profile.preset_engine when calling the function for a preset profile instead of a hardcoded/default value.
  2. In the API route, read the profile first and set the engine from profile.preset_engine before invoking synthesis.
  3. Restrict the client engine selector so users cannot choose an engine incompatible with a selected preset voice.
  4. If multi-engine support is required for the same voice, create separate preset profiles per engine.

Example fix

// before
prompt = await create_voice_prompt_from_profile(profile_id, db, engine='chatterbox')
// after: derive engine from the preset profile itself
profile = db.query(DBVoiceProfile).filter_by(id=profile_id).first()
prompt = await create_voice_prompt_from_profile(profile_id, db, engine=profile.preset_engine)
Defensive patterns

Strategy: validation

Validate before calling

profile = db.query(DBVoiceProfile).filter_by(id=profile_id).first()
if (profile.voice_type or 'cloned') == 'preset' and engine != profile.preset_engine:
    raise HTTPException(409, f"Engine {engine} incompatible with preset profile (use {profile.preset_engine})")

Try / catch

try:
    prompt = await create_voice_prompt_from_profile(profile_id, db, engine=engine)
except ValueError as e:
    if 'only supports engine' in str(e):
        raise HTTPException(409, str(e))
    raise

Prevention

When it happens

Trigger: Calling create_voice_prompt_from_profile(profile_id, db, engine='chatterbox') on a profile whose preset_engine is 'qwen'; defaulting the engine parameter to the server default when the preset profile was created for a different engine; client requests synthesis with an engine that does not match the preset profile's bound engine.

Common situations: Server default engine changed after preset profiles were created; client UI lets the user pick an engine independently of the selected preset voice; mixing preset profiles across multi-engine deployments without reconciling the engine param.

Related errors


AI-assisted analysis of jamiepine/voicebox@51f49dea19 (2026-08-12). Data as JSON: /api/errors/15712ce2b5de372e. Report an issue: GitHub.