HKUDS/DeepTutor · error · HTTPException
Failed to reload channels: {type(exc).__name__}
Error message
Failed to reload channels: {type(exc).__name__} What it means
500 raised by reload_partner_channels when mgr.reload_channels(partner_id) raises any unexpected exception. The detail deliberately leaks only the exception class name (e.g. 'ConnectionError'), and the full traceback goes to server logs via 'from None' suppression of the HTTP chain.
Source
Thrown at deeptutor/api/routers/partners.py:824
@router.delete("/{partner_id}", dependencies=_MANAGEABLE)
async def destroy_partner(partner_id: str):
destroyed = await get_partner_manager().destroy_partner(partner_id)
if not destroyed:
raise HTTPException(status_code=404, detail=t("api.partner_not_found"))
return {"partner_id": partner_id, "destroyed": True}
@router.post("/{partner_id}/channels/reload", dependencies=_MANAGEABLE)
async def reload_partner_channels(partner_id: str):
mgr = get_partner_manager()
instance = mgr.get_partner(partner_id)
if not instance or not instance.running:
raise HTTPException(status_code=404, detail=t("api.partner_not_running"))
try:
await mgr.reload_channels(partner_id)
except Exception as exc:
raise HTTPException(
status_code=500,
detail=f"Failed to reload channels: {type(exc).__name__}",
) from None
return {"partner_id": partner_id, "reloaded": True}
def _onboarding_manager_and_partner(partner_id: str):
mgr = get_partner_manager()
if not mgr.partner_exists(partner_id):
raise HTTPException(status_code=404, detail=t("api.partner_not_found"))
return get_channel_onboarding_manager(), mgr
@router.post("/{partner_id}/channel-onboarding/start", dependencies=_MANAGEABLE)
async def start_partner_channel_onboarding(partner_id: str, payload: ChannelOnboardingStartRequest):
onboarding, _ = _onboarding_manager_and_partner(partner_id)
try:
return await onboarding.start(partner_id, payload.channel)View on GitHub (pinned to 3e82f13042)
Solutions
- Check server logs — the exception type in the detail plus the logged traceback pinpoints the failing channel backend
- Validate the partner's channel configuration (credentials, endpoints) and fix the underlying provider issue
- Retry the reload once the provider/network is healthy; restart the partner if its runtime state is corrupted
Defensive patterns
Strategy: retry
Try / catch
except HTTPStatusError as e:
if e.response.status_code == 500:
log(e.response.json()["detail"]) # exception type name
backoff_and_retry(max_attempts=3) Prevention
- Keep channel provider credentials and endpoints validated before reload
- Watch server logs for the traceback behind the 500 detail
When it happens
Trigger: Any unexpected failure inside PartnerManager.reload_channels: broken channel provider credentials, malformed channel config file, network failure reaching the channel backend (Matrix homeserver, Discord gateway, etc.).
Common situations: Homeserver unreachable during Matrix channel reload; invalid/rotted auth token in partner channel config; config file schema changed after an upgrade.
Related errors
- t("api.partner_not_running")
- Channel config saved but failed to restart listeners ({type(
- str(exc)
- {str(e)}
- t("api.partner_not_found_or_not_running")
AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27).
Data as JSON: /api/errors/15426492171c7f8c.
Report an issue: GitHub.