{"record":{"id":"a15422eb327bfe66","repo":"HKUDS/DeepTutor","slug":"channel-onboarding-provider-request-failed-type","errorCode":null,"errorMessage":"Channel onboarding provider request failed ({type(exc).__name__})","messagePattern":"Channel onboarding provider request failed \\((.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":502,"severity":"error","filePath":"deeptutor/api/routers/partners.py","lineNumber":847,"sourceCode":"\n\ndef _onboarding_manager_and_partner(partner_id: str):\n    mgr = get_partner_manager()\n    if not mgr.partner_exists(partner_id):\n        raise HTTPException(status_code=404, detail=t(\"api.partner_not_found\"))\n    return get_channel_onboarding_manager(), mgr\n\n\n@router.post(\"/{partner_id}/channel-onboarding/start\", dependencies=_MANAGEABLE)\nasync def start_partner_channel_onboarding(partner_id: str, payload: ChannelOnboardingStartRequest):\n    onboarding, _ = _onboarding_manager_and_partner(partner_id)\n    try:\n        return await onboarding.start(partner_id, payload.channel)\n    except ChannelOnboardingError as exc:\n        raise HTTPException(status_code=exc.status_code, detail=str(exc)) from None\n    except Exception as exc:\n        logger.exception(\"Failed to start channel onboarding for '%s'\", partner_id)\n        raise HTTPException(\n            status_code=502,\n            detail=f\"Channel onboarding provider request failed ({type(exc).__name__})\",\n        ) from exc\n\n\n@router.get(\"/{partner_id}/channel-onboarding/{session_id}\", dependencies=_MANAGEABLE)\nasync def get_partner_channel_onboarding(partner_id: str, session_id: str):\n    onboarding, _ = _onboarding_manager_and_partner(partner_id)\n    try:\n        return await onboarding.status(partner_id, session_id)\n    except ChannelOnboardingError as exc:\n        raise HTTPException(status_code=exc.status_code, detail=str(exc)) from None\n    except Exception as exc:\n        logger.exception(\"Failed to poll channel onboarding for '%s'\", partner_id)\n        raise HTTPException(\n            status_code=502,\n            detail=f\"Channel onboarding provider request failed ({type(exc).__name__})\",\n        ) from exc","sourceCodeStart":829,"sourceCodeEnd":865,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/partners.py#L829-L865","documentation":"502 raised by start_partner_channel_onboarding as the catch-all for any non-ChannelOnboardingError exception raised by onboarding.start(). The original exception is logged (logger.exception) and chained; the client only sees the exception class name, marking it as an upstream provider/infrastructure failure rather than a caller error.","triggerScenarios":"Network-level failure reaching the channel onboarding provider (DNS, TLS, timeout), unexpected bug inside the onboarding manager, or serialization error of the provider response.","commonSituations":"Channel provider endpoint misconfigured or unreachable from the server; proxy/firewall blocking outbound calls; provider returned an unexpected response shape after an API change.","solutions":["Inspect server logs for the full traceback of the named exception type","Verify network reachability and credentials for the channel onboarding provider endpoint","Retry after fixing connectivity; report the exception type if it persists (likely a bug)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"except HTTPStatusError as e:\n    if e.response.status_code == 502:\n        await asyncio.sleep(2 ** attempt)\n        retry_start_onboarding()","preventionTips":["Verify provider endpoint reachability from the server host","Alert on repeated 502s — check logs for the chained traceback"],"tags":["http-502","onboarding","network","partners"],"backgroundTag":"upstream-provider-failure","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}