{"record":{"id":"b2f7c4ea21424e06","repo":"dotnet/runtime","slug":"pmi-not-found-at","errorCode":null,"errorMessage":"PMI not found at {}","messagePattern":"PMI not found at (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":3804,"sourceCode":"\ndef determine_pmi_location(coreclr_args):\n    \"\"\" Determine pmi.dll location, using the following steps:\n        First, use the `-pmi_location` argument, if set.\n        Else, look for pmi.dll on the PATH. This will be true if you build jitutils yourself\n            and put the built `bin` directory on your PATH.\n        Else, look for pmi.dll in Core_Root. This is where we cache it if downloaded from Azure Storage\n        Otherwise, download a cached copy from CLRJIT Azure Storage and cache it in Core_Root.\n\n    Args:\n        coreclr_args (CoreclrArguments) : parsed args\n\n    Returns:\n        pmi_location (str)     : path of pmi.dll\n    \"\"\"\n    if coreclr_args.pmi_location is not None:\n        pmi_location = os.path.abspath(coreclr_args.pmi_location)\n        if not os.path.isfile(pmi_location):\n            raise RuntimeError(\"PMI not found at {}\".format(pmi_location))\n        logging.info(\"Using PMI at %s\", pmi_location)\n    else:\n        path_var = os.environ.get(\"PATH\")\n        pmi_location = find_file(\"pmi.dll\", path_var.split(os.pathsep)) if path_var is not None else None\n        if pmi_location is not None:\n            logging.info(\"Using PMI found on PATH at %s\", pmi_location)\n        else:\n            pmi_location = os.path.join(coreclr_args.core_root, \"pmi.dll\")\n            if os.path.isfile(pmi_location):\n                logging.info(\"Using PMI found at %s\", pmi_location)\n            else:\n                pmi_uri = az_blob_storage_superpmi_container_uri + \"/pmi/pmi.dll\"\n                skip_progress = hasattr(coreclr_args, 'no_progress') and coreclr_args.no_progress\n                download_one_url(pmi_uri, pmi_location, is_azure_storage=True, display_progress=not skip_progress)\n\n    assert os.path.isfile(pmi_location)\n    return pmi_location\n","sourceCodeStart":3786,"sourceCodeEnd":3822,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi.py#L3786-L3822","documentation":"Raised by determine_pmi_location when the user explicitly passes --pmi_location but the resolved absolute path is not an existing file. pmi.dll is the SuperPMI private-method-invocation helper used for PMI-based collection/replay; the explicit path bypasses the PATH/Core_Root/download fallbacks, so a wrong path is a hard error.","triggerScenarios":"Called during PMI workflow setup (coreclr_args.pmi is True): coreclr_args.pmi_location is not None, os.path.abspath is applied, then os.path.isfile(pmi_location) is False. Occurs when the --pmi_location value is a typo, a relative path resolved against an unexpected cwd, a directory rather than a file, or a file that was moved/deleted.","commonSituations":"Pointing --pmi_location at a build output that doesn't exist yet (PMI not built); passing the directory containing pmi.dll instead of the file path; stale path from a different machine or checkout.","solutions":["Verify the path with 'ls <pmi_location>' and ensure it points to the pmi.dll/so file itself, not its parent directory.","Drop --pmi_location to let the script find pmi.dll via PATH or Core_Root, or auto-download it from Azure Storage.","Build pmi from the jitutils repo (https://github.com/dotnet/jitutils) if you need a local copy and confirm the output path."],"exampleFix":"// before\nif coreclr_args.pmi_location is not None:\n    pmi_location = os.path.abspath(coreclr_args.pmi_location)\n    if not os.path.isfile(pmi_location):\n        raise RuntimeError(\"PMI not found at {}\".format(pmi_location))\n// after\nif coreclr_args.pmi_location is not None:\n    pmi_location = os.path.abspath(coreclr_args.pmi_location)\n    if not os.path.isfile(pmi_location):\n        raise RuntimeError(f\"PMI not found at {pmi_location}; pass the pmi.dll file path, or omit --pmi_location to auto-resolve\")","handlingStrategy":"validation","validationCode":"import os\ndef validate_pmi_location(pmi_location):\n    if pmi_location is None:\n        return None  # let auto-resolution handle it\n    abs_path = os.path.abspath(pmi_location)\n    if not os.path.isfile(abs_path):\n        raise RuntimeError(f\"--pmi_location is not a file: {abs_path}. Omit the flag to auto-resolve from PATH/Core_Root/download.\")\n    return abs_path","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point --pmi_location at the pmi.dll/so file itself, not its directory.","Omit --pmi_location to let SuperPMI find or download pmi.dll automatically.","Build pmi from jitutils only when you need a custom build."],"tags":["pmi","configuration","path","superpmi"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}