{"record":{"id":"8018f8fe54bf32fb","repo":"commaai/openpilot","slug":"profile-installation-failed-at-cmd-name-err-na","errorCode":null,"errorMessage":"Profile installation failed at {cmd_name}: {err_name}","messagePattern":"Profile installation failed at (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"openpilot/common/esim/lpa.py","lineNumber":592,"sourceCode":"\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\n\ndef cancel_session(client: AtClient, transaction_id: bytes, reason: int = 127) -> str:\n  content = encode_tlv(0x80, transaction_id) + encode_tlv(0x81, bytes([reason]))\n  response = es10x_command(client, encode_tlv(TAG_CANCEL_SESSION, content))\n  return b64e(response)\n\n","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/commaai/openpilot/blob/516ec1e68203439a73f340f1d0b3b91eabc626ee/openpilot/common/esim/lpa.py#L574-L610","documentation":"Raised during eSIM profile installation when the eUICC returns a negative installationResult for a specific BPP (Bound Profile Package) command and no canned message exists for that errorReason. The message names the failing BPP command (e.g. storeMetadata, loadProfileElements) and the eUICC's error reason. It means the modem/eUICC rejected a step of the profile download transaction.","triggerScenarios":"Calling download_profile() where the profileInstallResult parse yields success=False with a non-null errorReason that is not in BPP_ERROR_MESSAGES; e.g. eUICC memory full, profile Nicholas mismatch, or an invalid BPP structure returned by the SM-DP+ server.","commonSituations":"SM-DP+ server sends a malformed or incompatible BPP; eUICC out of free space; mismatched SM-DP+ address / matching ID leading to a corrupt session; incompatible eUICC firmware.","solutions":["Retry download_profile with a fresh activation code (the SM-DP+ may have a stuck transaction)","Call list_profiles and delete unused profiles to free eUICC memory","Verify the activation code and SM-DP+ server are correct and the operator supports the device eUICC","Check modem firmware / eUICC version compatibility with the profile"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    download_profile(client, code)\nexcept RuntimeError as e:\n    if \"Profile installation failed\" in str(e):\n        # free space / retry with new activation code\n        ...","preventionTips":["Free eUICC space by deleting unused profiles before downloading","Use fresh, single-use activation codes","Ensure a stable modem connection before starting installation"],"tags":["esim","lpa","euicc","embedded"],"backgroundTag":null,"analyzedSha":"516ec1e68203439a73f340f1d0b3b91eabc626ee","analyzedAt":"2026-08-15T00:17:37.461Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}