HKUDS/DeepTutor · error · HTTPException

{str(e)}

Error message

{str(e)}

What it means

Top-level catch-all in the public get_rag_providers handler: any unexpected exception while assembling the provider list (config loading, registry import, provider status probing) is logged and re-raised as HTTP 500 with the original message. It signals a server-side bug or broken environment, not a client mistake.

Source

Thrown at deeptutor/api/routers/knowledge.py:1154

    try:
        from deeptutor.services.config import get_kb_config_service
        from deeptutor.services.rag.service import RAGService

        providers = RAGService.list_providers()
        kb_config = get_kb_config_service()
        for provider in providers:
            modes = provider.get("modes") or []
            if modes:
                stored = kb_config.get_provider_mode(provider["id"])
                if stored in modes:
                    provider["default_mode"] = stored
            # Whether an existing index for this engine can be linked in place
            # (self-contained on disk). Drives the "link existing folder" UI.
            provider["linkable"] = provider.get("id") in LINKABLE_PROVIDERS
        return {"providers": providers}
    except Exception as e:
        logger.error(f"Error getting RAG providers: {e}")
        raise HTTPException(status_code=500, detail=str(e))


class ProviderModeUpdate(BaseModel):
    """Set an engine's global default retrieval mode (from its engine card)."""

    mode: str


@router.put("/rag-providers/{provider}/mode")
async def set_rag_provider_mode(provider: str, payload: ProviderModeUpdate):
    """Persist the default retrieval mode for a mode-aware engine.

    The mode must be one the engine supports; a KB's own ``search_mode`` still
    overrides this per-KB default.
    """
    from deeptutor.services.config import get_kb_config_service
    from deeptutor.services.rag.service import RAGService

View on GitHub (pinned to 3e82f13042)

Solutions

  1. Check the server logs — the line 'Error getting RAG providers' includes the underlying exception
  2. Validate/repair the settings JSON under data/user/settings/
  3. Reinstall missing extras (graphrag/lightrag) if the log shows ImportError
  4. Report upstream with the stack trace if the cause is inside deeptutor itself
Defensive patterns

Strategy: retry

Try / catch

try: providers = client.get('/api/v1/knowledge/rag/providers').json()
except HTTPError as e:
    if e.response.status_code == 500: log_server_error(); alert_admin(e.response.json()['detail'])

Prevention

When it happens

Trigger: GET on the RAG providers listing endpoint when provider discovery throws — broken settings JSON, an import error inside a pipeline module, or an exception from a provider status helper.

Common situations: Corrupted data/user/settings file; partially installed extras causing ImportError during provider registry build; provider config helpers raising on malformed values after a version upgrade.

Related errors


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/a843b0d7ad78fbc2. Report an issue: GitHub.