{"record":{"id":"22e4a6f1515574ab","repo":"commaai/openpilot","slug":"profile-installation-failed-no-result-from-euicc","errorCode":null,"errorMessage":"Profile installation failed: no result from eUICC","messagePattern":"Profile installation failed: no result from eUICC","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"openpilot/common/esim/lpa.py","lineNumber":585,"sourceCode":"        if bpp_cmd:\n          result[\"bppCommandId\"] = int.from_bytes(bpp_cmd, \"big\")\n        err = find_tag(value, 0x81)\n        if err:\n          result[\"errorReason\"] = int.from_bytes(err, \"big\")\n  return result\n\n\ndef load_bpp(client: AtClient, b64_bpp: str) -> dict:\n  bpp = b64d(b64_bpp)\n  result = None\n  for chunk in _split_bpp(bpp):\n    response = es10x_command(client, chunk)\n    if response and (parsed := _parse_install_result(response)):\n      result = parsed\n      break\n\n  if result is None:\n    raise RuntimeError(\"Profile installation failed: no result from eUICC\")\n  if not result[\"success\"] and result[\"errorReason\"] is not None:\n    msg = BPP_ERROR_MESSAGES.get(result[\"errorReason\"])\n    if not msg:\n      cmd_name = BPP_COMMAND_NAMES.get(result[\"bppCommandId\"], f\"unknown({result['bppCommandId']})\")\n      err_name = BPP_ERROR_REASONS.get(result[\"errorReason\"], f\"unknown({result['errorReason']})\")\n      msg = f\"Profile installation failed at {cmd_name}: {err_name}\"\n    raise RuntimeError(msg)\n  if not result[\"success\"]:\n    raise RuntimeError(\"Profile installation failed: no result from eUICC\")\n  return result\n\n\ndef parse_metadata(b64_metadata: str) -> dict:\n  root = find_tag(b64d(b64_metadata), TAG_PROFILE_METADATA)\n  if root is None:\n    raise RuntimeError(\"Invalid profileMetadata\")\n  return decode_struct(root, PROFILE)\n","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/commaai/openpilot/blob/516ec1e68203439a73f340f1d0b3b91eabc626ee/openpilot/common/esim/lpa.py#L567-L603","documentation":"load_bpp() sends each BPP chunk to the eUICC and looks for an install result (parsed via _parse_install_result) in the responses. If no chunk produced a recognizable ProfileInstallResult, RuntimeError('Profile installation failed: no result from eUICC') is raised. The same message is reused at the tail for a parsed-but-unsuccessful result with no errorReason.","triggerScenarios":"Installation sequence completes (or aborts) without the eUICC emitting the BF37 install-result structure: eUICC stopped responding mid-load (modem/channel loss swallowed by retries), response TLVs unrecognized by the parser, or the session was cancelled server-side so no final result arrives.","commonSituations":"Modem serial hiccups during the long multi-APDU load; eUICC firmware returning a result layout the parser doesn't recognize; timeouts between chunks; mismatch between chunk segmentation (ES10X_MSS=120) and eUICC expectations.","solutions":["Enable DEBUG=1 to capture the full APDU transcript and see where the eUICC stopped answering","Reset modem + reopen ISD-R, then restart the entire download flow from the QR code (the BPP session cannot be resumed)","Check whether the profile actually installed despite the missing result (list_profiles) before re-downloading — re-downloading an installed profile triggers 'already installed' errors","If the eUICC consistently returns nothing after loadProfileElements, suspect eUICC memory/state — delete profiles and retry"],"exampleFix":"# before\nresult = load_bpp(client, b64_bpp)\n# RuntimeError: Profile installation failed: no result from eUICC\n\n# after — verify actual state before assuming failure\nfrom openpilot.common.esim.lpa import load_bpp, list_profiles\n\ntry:\n  result = load_bpp(client, b64_bpp)\nexcept RuntimeError:\n  installed = any(p['iccid'] == expected_iccid for p in list_profiles(client))\n  if installed:\n    result = {'success': True, 'errorReason': None}\n  else:\n    raise","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openpilot.common.esim.lpa import load_bpp, list_profiles\n\ntry:\n  result = load_bpp(client, b64_bpp)\nexcept RuntimeError as e:\n  if 'no result from eUICC' in str(e):\n    # fallback: eUICC may have installed despite losing the result APDU\n    if any(p['iccid'] == expected_iccid for p in list_profiles(client)):\n      result = {'success': True}\n    else:\n      client._reset_modem()\n      raise SystemExit('install incomplete; restart download with a fresh QR/session') from e\n  raise","preventionTips":["Always check list_profiles after an install error before re-downloading (double-install hits error 9)","Restart the whole download flow from the QR on install failure — BPP sessions are not resumable","Keep the modem stable during installs: no concurrent AT traffic, hold the modem lock"],"tags":["esim","installation","euicc","download","bpp","python"],"backgroundTag":null,"analyzedSha":"516ec1e68203439a73f340f1d0b3b91eabc626ee","analyzedAt":"2026-08-15T00:17:37.461Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}