lfnovo/open-notebook · error · HTTPException
Failed to fetch episode profile
Error message
Failed to fetch episode profile
What it means
Generic 500 raised when fetching a single episode profile fails unexpectedly (outside HTTPException/OpenNotebookError). The underlying exception is logged with the profile name.
Source
Thrown at api/routers/episode_profiles.py:119
try:
profile = await EpisodeProfile.get_by_name(profile_name)
if not profile:
raise HTTPException(
status_code=404, detail=f"Episode profile '{profile_name}' not found"
)
return _profile_to_response(
profile, await _speaker_name_for(profile.speaker_config)
)
except HTTPException:
raise
except OpenNotebookError:
raise
except Exception as e:
logger.error(f"Failed to fetch episode profile '{profile_name}': {e}")
raise HTTPException(
status_code=500, detail="Failed to fetch episode profile"
)
class EpisodeProfileCreate(BaseModel):
name: str = Field(..., description="Unique profile name")
description: str = Field("", description="Profile description")
speaker_config: str = Field(
...,
description=(
"speaker_profile record ID (a profile name is also accepted "
"for backward compatibility)"
),
)
outline_llm: Optional[str] = Field(None, description="Model record ID for outline")
transcript_llm: Optional[str] = Field(
None, description="Model record ID for transcript"
)View on GitHub (pinned to a7de90d38a)
Solutions
- Check the API log line 'Failed to fetch episode profile <name>' for the traceback
- Verify the profile's speaker_config references an existing SpeakerProfile
- Confirm DB health and retry
- Repair or clear dangling references on the profile record
Defensive patterns
Strategy: retry
Try / catch
try:
return await client.get(f"/api/episode-profiles/{quote(name)}")
except httpx.HTTPStatusError as e:
if e.response.status_code >= 500:
await asyncio.sleep(1)
return await client.get(f"/api/episode-profiles/{quote(name)}")
raise Prevention
- Keep episode profiles' speaker_config pointing at live SpeakerProfile records
- Check server logs for the traceback before guessing
- Use dependency health checks before reads
When it happens
Trigger: DB connectivity failure during EpisodeProfile.get_by_name, or an exception while building the response (e.g., resolving the speaker name for profile.speaker_config fails).
Common situations: SurrealDB down or restarting; the profile references a dangling speaker_config that blows up during _speaker_name_for; schema changes after partial migration.
Related errors
- Failed to fetch episode profiles
- Failed to create episode profile
- Failed to update episode profile
- Failed to delete episode profile
- Failed to duplicate episode profile
AI-assisted analysis of lfnovo/open-notebook@a7de90d38a (2026-08-27).
Data as JSON: /api/errors/4488bfd3ccfec640.
Report an issue: GitHub.