{"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/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi.py#L3786-L3822","documentation":"Raised in `determine_pmi_location` (superpmi.py:3803-3804) when `-pmi_location` is supplied but does not point to an existing file. When the user explicitly names a pmi.dll, the script trusts that path and validates it exists rather than falling back to PATH/Core_Root/download.","triggerScenarios":"Passing `-pmi_location <path>` to the collect subcommand where the path does not exist on disk. The check is an os.path.isfile on the absolute path before any fallback logic.","commonSituations":"Typo in the path; pointing at a stale pmi.dll from a removed build; relative path that resolves wrong under a different cwd; passing a directory instead of the dll file.","solutions":["Verify the path with `ls <path>` and correct typos; use an absolute path to the pmi.dll.","Drop `-pmi_location` entirely to let the script find pmi.dll on PATH, in Core_Root, or download it from Azure Storage.","Rebuild/restore pmi.dll (from the jitutils repo) if the file is genuinely missing."],"exampleFix":"// before\nsuperpmi.py collect --pmi -pmi_location ./bin/pmi.dll -assemblies Foo\n// after\nsuperpmi.py collect --pmi -pmi_location /abs/path/to/jitutils/bin/pmi.dll -assemblies Foo","handlingStrategy":"validation","validationCode":"import os\nif args.pmi_location is not None:\n    pmi = os.path.abspath(args.pmi_location)\n    if not os.path.isfile(pmi):\n        raise SystemExit(f'-pmi_location {pmi} is not a file; omit the flag to auto-resolve/download pmi.dll')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths for -pmi_location.","Omit -pmi_location to let the script find or download pmi.dll."],"tags":["pmi","config","file-io","superpmi"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}