commaai/openpilot · error · RuntimeError

Profile installation failed at {cmd_name}: {err_name}

Error message

Profile installation failed at {cmd_name}: {err_name}

What it means

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.

Source

Thrown at openpilot/common/esim/lpa.py:592

def load_bpp(client: AtClient, b64_bpp: str) -> dict:
  bpp = b64d(b64_bpp)
  result = None
  for chunk in _split_bpp(bpp):
    response = es10x_command(client, chunk)
    if response and (parsed := _parse_install_result(response)):
      result = parsed
      break

  if result is None:
    raise RuntimeError("Profile installation failed: no result from eUICC")
  if not result["success"] and result["errorReason"] is not None:
    msg = BPP_ERROR_MESSAGES.get(result["errorReason"])
    if not msg:
      cmd_name = BPP_COMMAND_NAMES.get(result["bppCommandId"], f"unknown({result['bppCommandId']})")
      err_name = BPP_ERROR_REASONS.get(result["errorReason"], f"unknown({result['errorReason']})")
      msg = f"Profile installation failed at {cmd_name}: {err_name}"
    raise RuntimeError(msg)
  if not result["success"]:
    raise RuntimeError("Profile installation failed: no result from eUICC")
  return result


def parse_metadata(b64_metadata: str) -> dict:
  root = find_tag(b64d(b64_metadata), TAG_PROFILE_METADATA)
  if root is None:
    raise RuntimeError("Invalid profileMetadata")
  return decode_struct(root, PROFILE)


def cancel_session(client: AtClient, transaction_id: bytes, reason: int = 127) -> str:
  content = encode_tlv(0x80, transaction_id) + encode_tlv(0x81, bytes([reason]))
  response = es10x_command(client, encode_tlv(TAG_CANCEL_SESSION, content))
  return b64e(response)

View on GitHub (pinned to 516ec1e682)

Solutions

  1. Retry download_profile with a fresh activation code (the SM-DP+ may have a stuck transaction)
  2. Call list_profiles and delete unused profiles to free eUICC memory
  3. Verify the activation code and SM-DP+ server are correct and the operator supports the device eUICC
  4. Check modem firmware / eUICC version compatibility with the profile
Defensive patterns

Strategy: try-catch

Try / catch

try:
    download_profile(client, code)
except RuntimeError as e:
    if "Profile installation failed" in str(e):
        # free space / retry with new activation code
        ...

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of commaai/openpilot@516ec1e682 (2026-08-15). Data as JSON: /api/errors/8018f8fe54bf32fb. Report an issue: GitHub.