{"record":{"id":"a08687ba0a03a84f","repo":"dotnet/runtime","slug":"unable-to-find-mingit-asset-for-arch-arch-ava","errorCode":null,"errorMessage":"Unable to find MinGit asset for arch '{arch}'. Available assets: {[a['name'] for a in assets if 'MinGit' in a['name']]}","messagePattern":"Unable to find MinGit asset for arch '(.+?)'\\. Available assets: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi_aspnet2.py","lineNumber":99,"sourceCode":"        print(\"git found\")\n        return\n    if sys.platform == \"win32\":\n        print(\"git not found, downloading portable git...\")\n        m = {\"x64\": \"64-bit\", \"arm64\": \"arm64\", \"x86\": \"32-bit\"}\n        assets = requests.get(\n            \"https://api.github.com/repos/git-for-windows/git/releases/latest\", timeout=100\n        ).json()[\"assets\"]\n        rx = re.compile(r\"^MinGit-.*-(32-bit|64-bit|arm64)\\.zip$\", re.I)\n        arch = \"x64\"\n        mach = platform.machine().lower()\n        if \"arm64\" in mach:\n            arch = \"arm64\"\n        elif mach in (\"x86\", \"i386\", \"i686\"):\n            arch = \"x86\"\n        try:\n            asset = next(a for a in assets if rx.match(a[\"name\"]) and m[arch] in a[\"name\"]) \n        except StopIteration:\n            raise RuntimeError(\n                f\"Unable to find MinGit asset for arch '{arch}'. Available assets: \"\n                f\"{[a['name'] for a in assets if 'MinGit' in a['name']]}\"\n            )\n        dest_str = str(dest)\n        os.makedirs(dest_str, exist_ok=True)\n        zip_path = os.path.join(dest_str, asset[\"name\"]) \n        with requests.get(asset[\"browser_download_url\"], stream=True) as r, open(zip_path, \"wb\") as f:\n            for c in r.iter_content(8192):\n                f.write(c)\n        git_dir = os.path.join(dest_str, \"git\")\n        shutil.rmtree(git_dir, ignore_errors=True)\n        with zipfile.ZipFile(zip_path) as z:\n            z.extractall(git_dir)\n        os.remove(zip_path)\n        cmd_path = os.path.join(git_dir, \"cmd\")\n        os.environ[\"PATH\"] = cmd_path + os.pathsep + os.environ.get(\"PATH\", \"\")\n        return\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi_aspnet2.py#L81-L117","documentation":"Raised by ensure_git() in superpmi_aspnet2.py at src/coreclr/scripts/superpmi_aspnet2.py:99 on Windows when git is not installed and no MinGit release asset matches the detected architecture. It queries the latest git-for-windows GitHub release and matches the MinGit zip against x86/x64/arm64; a StopIteration on the asset search triggers the RuntimeError.","triggerScenarios":"Running on a Windows agent without git where platform.machine() returns a value not mapping to x86/x64/arm64, or the git-for-windows latest release has no matching MinGit asset (transient GitHub API response or release not yet published for that arch).","commonSituations":"Helix/CI agents with unusual machine names, incomplete GitHub API response, or a new arch label absent from the m={'x64','x86','arm64'} mapping.","solutions":["Pre-install git on the Windows agent and put it on PATH so shutil.which('git') short-circuits the download.","Retry the job — the GitHub releases API may have returned an incomplete asset list.","Confirm the latest git-for-windows release actually published a MinGit asset for your arch.","Pin a known-good git-for-windows release URL instead of always querying 'latest'."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if sys.platform == 'win32':\n    mach = platform.machine().lower()\n    arch = 'arm64' if 'arm64' in mach else ('x86' if mach in ('x86', 'i386', 'i686') else 'x64')\n    if arch not in ('x86', 'x64', 'arm64'):\n        raise SystemExit(f\"Cannot map platform.machine() '{mach}' to a MinGit arch\")","typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        ensure_git(tools_dir)\n        break\n    except RuntimeError as e:\n        if 'MinGit asset' in str(e) and attempt < 2:\n            time.sleep(5)\n            continue\n        raise","preventionTips":["Install git on Windows CI agents so ensure_git() returns early via shutil.which('git').","Pin a known-good git-for-windows release URL instead of always querying 'latest'."],"tags":["dotnet","coreclr","superpmi","windows","git","network"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}