@htekdev/actions-debugger 1.0.110 → 1.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,132 @@
1
+ id: runner-environment-180
2
+ title: 'ubuntu-24.04 removes Mono/MSBuild/NuGet — .NET Framework net48/net40 builds fail with "command not found"'
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - ubuntu-24
7
+ - ubuntu-latest
8
+ - mono
9
+ - msbuild
10
+ - nuget
11
+ - dotnet-framework
12
+ - migration
13
+ - tool-removed
14
+ patterns:
15
+ - regex: 'mono: command not found'
16
+ flags: 'i'
17
+ - regex: 'msbuild: command not found'
18
+ flags: 'i'
19
+ - regex: '/usr/bin/msbuild.*No such file or directory'
20
+ flags: 'i'
21
+ - regex: 'nuget: command not found'
22
+ flags: 'i'
23
+ - regex: 'Could not find file.*msbuild\.exe'
24
+ flags: 'i'
25
+ error_messages:
26
+ - "mono: command not found"
27
+ - "msbuild: command not found"
28
+ - "nuget: command not found"
29
+ - "/usr/bin/msbuild: No such file or directory"
30
+ - "bash: line 1: mono: command not found"
31
+ root_cause: |
32
+ When GitHub Actions migrated `ubuntu-latest` to Ubuntu 24.04 (rollout Dec 2024 –
33
+ Jan 2025, runner-images#10636), the Mono framework, mono-based MSBuild, and mono-based
34
+ NuGet were intentionally removed from the Ubuntu 24.04 runner image. These packages
35
+ are not available in Ubuntu 24.04 (Noble Numbat) apt repositories because Mono is not
36
+ maintained for Noble.
37
+
38
+ Affected workflows:
39
+ - .NET Framework projects targeting net40, net45, net46, net47, net48 built on Linux
40
+ using Mono (common for Unity CI, Windows-targeted libraries, legacy C# projects)
41
+ - Any workflow running `mono`, `msbuild`, or `nuget` shell commands on ubuntu-latest
42
+ - Third-party actions that internally call mono (e.g., Unity build actions, some .NET
43
+ test runners)
44
+
45
+ The failure is immediate and obvious ("command not found") but the root cause is often
46
+ unclear because the workflow worked fine on ubuntu-22.04. The ubuntu-latest label
47
+ silently changed the underlying image, not the workflow YAML.
48
+
49
+ Source: actions/runner-images#10636 (384 reactions, closed Jan 2025),
50
+ actions/runner-images#11675 (mono specifically, closed "not planned" — Mono will NOT
51
+ be added back to ubuntu-24.04).
52
+ fix: |
53
+ Option 1 (recommended for most cases): Switch to windows-latest
54
+ .NET Framework targets are first-class on Windows runners which still include MSBuild,
55
+ NuGet, and full .NET Framework support. Most .csproj net48 builds run correctly on
56
+ windows-latest.
57
+
58
+ Option 2: Install Mono at runtime on Ubuntu 22.04 (not 24.04)
59
+ Pin to ubuntu-22.04 (supported until April 2027) and install Mono via apt at runtime:
60
+ sudo apt-get install -y mono-complete msbuild
61
+
62
+ Option 3: Migrate to .NET Core / .NET 6+ with multi-targeting
63
+ Add a `net8.0` target to your csproj alongside `net48` for CI builds on Linux, and
64
+ build the Linux target on ubuntu-latest. The Windows-only target can be built on
65
+ windows-latest in a separate matrix job.
66
+
67
+ Option 4: Use a Docker container with Mono
68
+ Run the build step in a `mono:latest` container:
69
+ container: mono:latest
70
+ fix_code:
71
+ - language: yaml
72
+ label: 'Switch net48 / Mono builds to windows-latest'
73
+ code: |
74
+ jobs:
75
+ build:
76
+ runs-on: windows-latest # .NET Framework is fully supported on Windows runners
77
+ steps:
78
+ - uses: actions/checkout@v4
79
+ - name: Setup MSBuild
80
+ uses: microsoft/setup-msbuild@v2
81
+ - name: Restore NuGet packages
82
+ run: nuget restore MySolution.sln
83
+ - name: Build
84
+ run: msbuild MySolution.sln /p:Configuration=Release
85
+ - language: yaml
86
+ label: 'Pin to ubuntu-22.04 and install Mono at runtime'
87
+ code: |
88
+ jobs:
89
+ build:
90
+ runs-on: ubuntu-22.04 # ubuntu-24.04 has no Mono; 22.04 supported until April 2027
91
+ steps:
92
+ - uses: actions/checkout@v4
93
+ - name: Install Mono
94
+ run: |
95
+ sudo apt-get update -q
96
+ sudo apt-get install -y mono-complete msbuild
97
+ - name: Build
98
+ run: msbuild MySolution.sln /p:Configuration=Release
99
+ - language: yaml
100
+ label: 'Matrix build separating Linux .NET Core from Windows .NET Framework'
101
+ code: |
102
+ jobs:
103
+ build:
104
+ strategy:
105
+ matrix:
106
+ include:
107
+ - os: ubuntu-latest
108
+ target: net8.0
109
+ - os: windows-latest
110
+ target: net48
111
+ runs-on: ${{ matrix.os }}
112
+ steps:
113
+ - uses: actions/checkout@v4
114
+ - uses: microsoft/setup-msbuild@v2
115
+ if: runner.os == 'Windows'
116
+ - name: Build
117
+ run: dotnet build -f ${{ matrix.target }} -c Release
118
+ prevention:
119
+ - 'Pin `runs-on: ubuntu-22.04` for any workflow requiring Mono, msbuild, or nuget CLI on Linux'
120
+ - 'Use `windows-latest` for all .NET Framework (net40/45/46/47/48) builds — MSBuild is native there'
121
+ - 'Audit workflows for bare `mono`, `msbuild`, or `nuget` commands before migrating ubuntu-latest'
122
+ - 'Consider migrating legacy .NET Framework projects to .NET 8+ for platform-agnostic CI'
123
+ - 'Check runner software lists at https://github.com/actions/runner-images for tool availability per OS'
124
+ docs:
125
+ - url: 'https://github.com/actions/runner-images/issues/10636'
126
+ label: 'actions/runner-images#10636: Ubuntu-latest migrates to Ubuntu-24.04 (384 reactions, Jan 2025)'
127
+ - url: 'https://github.com/actions/runner-images/issues/11675'
128
+ label: 'actions/runner-images#11675: Mono missing on Ubuntu 24.04 (closed not_planned — will not be added back)'
129
+ - url: 'https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md'
130
+ label: 'Ubuntu 24.04 runner image software list'
131
+ - url: 'https://github.com/microsoft/setup-msbuild'
132
+ label: 'microsoft/setup-msbuild action for Windows runners'
@@ -0,0 +1,114 @@
1
+ id: runner-environment-181
2
+ title: 'Self-hosted Windows runner steps stuck "Waiting for a runner to pick up this job..." mid-job after v2.321.0 auto-update'
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - self-hosted
7
+ - windows
8
+ - runner-update
9
+ - stuck
10
+ - queued
11
+ - multi-step
12
+ - message-queue
13
+ patterns:
14
+ - regex: 'Waiting for a runner to pick up this job'
15
+ flags: 'i'
16
+ - regex: 'Current runner version.*2\.32[1-9]|v2\.32[1-9]\.'
17
+ flags: 'i'
18
+ error_messages:
19
+ - "Waiting for a runner to pick up this job..."
20
+ root_cause: |
21
+ After the GitHub Actions runner auto-updated to v2.321.0 (released November 2024),
22
+ Windows self-hosted runners began exhibiting a specific failure mode in multi-step
23
+ jobs: the first step of a job executes successfully, but subsequent steps hang
24
+ indefinitely in a queued state showing "Waiting for a runner to pick up this job..."
25
+
26
+ Root cause: The v2.321.0 update introduced a regression in the Windows runner's
27
+ inter-step message queue session management. After completing a step, the runner
28
+ sends a completion signal to the GitHub broker but fails to maintain the job session
29
+ channel open for the next step. GitHub's broker interprets the broken session as
30
+ the job needing a fresh runner allocation — hence the "waiting for runner" message
31
+ for a job that is technically already in-flight.
32
+
33
+ The runner service itself remains running and reports "idle" to GitHub, but the job
34
+ session token has already been invalidated or the queue socket closed. Restarting
35
+ the runner service re-establishes the connection and any subsequent cancel+rerun
36
+ immediately picks up because the session management is freshly initialized.
37
+
38
+ Characteristics:
39
+ - Specific to Windows self-hosted runners (not Ubuntu/macOS hosted runners)
40
+ - Only occurs in jobs with 2 or more steps
41
+ - Step 1 always completes; step 2+ hangs without timeout
42
+ - Cancel + rerun of the stuck job resolves it immediately
43
+ - Runner service restart also resolves it
44
+ - Began appearing after Nov 27, 2024 auto-update on Windows machines
45
+ - Still open as of May 2026 with 90+ reactions (actions/runner#3609)
46
+
47
+ Note: This is distinct from runner-environment-082 (runner stuck between JOBS in
48
+ the same workflow) — this failure occurs between STEPS within a single job.
49
+ fix: |
50
+ Immediate mitigation:
51
+ 1. Cancel the stuck run in the GitHub Actions UI and re-run it — the job typically
52
+ completes correctly on rerun because the session is re-initialized.
53
+ 2. Restart the GitHub Actions runner service on the Windows host between runs:
54
+ Restart-Service -Name "actions.runner.*"
55
+ (replace wildcard with the actual runner service name from services.msc)
56
+
57
+ Permanent mitigation:
58
+ 3. Upgrade the runner to the latest version (v2.334.0+) which includes session
59
+ management improvements. Check https://github.com/actions/runner/releases for
60
+ the latest stable version.
61
+ 4. Disable auto-update and pin to a known-good runner version by setting
62
+ `RUNNER_ALLOW_RUNASROOT=false` and specifying the version in your runner
63
+ configuration script.
64
+ 5. If operating ARC (Actions Runner Controller), upgrade the controller to use a
65
+ runner image version 2.334.0+ to pick up the fix.
66
+ fix_code:
67
+ - language: yaml
68
+ label: 'Workflow with restart-runner step for self-hosted Windows runners (workaround)'
69
+ code: |
70
+ # Workaround: add a pre-step that verifies the runner session is healthy.
71
+ # This forces a new session token for each major step block.
72
+ jobs:
73
+ build:
74
+ runs-on: [self-hosted, windows]
75
+ steps:
76
+ - name: Verify runner session (workaround for runner#3609)
77
+ run: Write-Host "Runner session active — version $env:RUNNER_VERSION"
78
+ shell: pwsh
79
+
80
+ - uses: actions/checkout@v4
81
+
82
+ - name: Build
83
+ run: dotnet build
84
+ shell: pwsh
85
+ - language: yaml
86
+ label: 'Script to upgrade self-hosted runner to latest version on Windows'
87
+ code: |
88
+ # Run on each Windows runner host to upgrade to the latest runner version.
89
+ # Execute from PowerShell as Administrator.
90
+
91
+ # Stop the runner service
92
+ Stop-Service -Name "actions.runner.*" -Force
93
+
94
+ # Download and replace the runner binary
95
+ $version = (Invoke-RestMethod "https://api.github.com/repos/actions/runner/releases/latest").tag_name.TrimStart('v')
96
+ Invoke-WebRequest "https://github.com/actions/runner/releases/download/v$version/actions-runner-win-x64-$version.zip" -OutFile runner.zip
97
+ Expand-Archive runner.zip -DestinationPath . -Force
98
+
99
+ # Restart the service
100
+ Start-Service -Name "actions.runner.*"
101
+ Write-Host "Runner upgraded to v$version"
102
+ prevention:
103
+ - 'Keep self-hosted runners updated to the latest runner version — regression fixes are frequent'
104
+ - 'Monitor runner logs at _diag/Runner_*.log for session/message-queue errors between steps'
105
+ - 'Set up automatic runner version checks in your infrastructure pipeline'
106
+ - 'For critical pipelines, disable auto-update and pin to a tested runner version then upgrade on schedule'
107
+ - 'On Windows hosts, ensure the runner service account has rights to re-establish named pipe connections between steps'
108
+ docs:
109
+ - url: 'https://github.com/actions/runner/issues/3609'
110
+ label: 'actions/runner#3609: Self-hosted runner stuck "Waiting for runner" in multi-step jobs (90 reactions, open Dec 2024)'
111
+ - url: 'https://github.com/actions/runner/releases'
112
+ label: 'GitHub Actions Runner releases — check for v2.321.0 regression fixes'
113
+ - url: 'https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners'
114
+ label: 'GitHub Docs: About self-hosted runners'
@@ -0,0 +1,102 @@
1
+ id: runner-environment-179
2
+ title: 'Runner Registration Token Endpoint Returns 502 Under Concurrent Spawn Bursts'
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - self-hosted
7
+ - ephemeral
8
+ - registration
9
+ - autoscaler
10
+ - burst
11
+ - 502
12
+ patterns:
13
+ - regex: 'HTTP Error 502: Bad Gateway'
14
+ flags: 'i'
15
+ - regex: 'registration-token.*502|502.*Bad Gateway.*registration'
16
+ flags: 'i'
17
+ - regex: 'HTTPError.*502|urlopen error.*502'
18
+ flags: 'i'
19
+ error_messages:
20
+ - 'HTTP Error 502: Bad Gateway'
21
+ - 'urllib.error.HTTPError: HTTP Error 502: Bad Gateway'
22
+ - 'POST https://api.github.com/repos/{owner}/{repo}/actions/runners/registration-token — 502'
23
+ root_cause: |
24
+ GitHub REST endpoint:
25
+ POST https://api.github.com/repos/{owner}/{repo}/actions/runners/registration-token
26
+
27
+ returns HTTP 502 Bad Gateway under burst load when many ephemeral runners attempt to
28
+ register concurrently (e.g., triggered by webhook-driven autoscalers on workflow_job.queued
29
+ events). The burst saturates the GitHub backend's registration token issuer.
30
+
31
+ The reference runner setup scripts (run.sh / config.sh flow) do NOT retry 5xx responses —
32
+ a single transient 502 causes the container to exit immediately before registration completes.
33
+ For ephemeral autoscaler setups (Modal, Lambda, Kubernetes pod-per-job), the container slot
34
+ is burned and no runner is available for the queued job.
35
+
36
+ Phantom containers accumulate: the autoscaler billed for the container, GitHub never received
37
+ a registration, and the autoscaler's max_containers cap can be held by dead slots — stalling
38
+ the merge queue for hours.
39
+
40
+ Source: actions/runner#4399 (May 2026, open issue, observed during 20+ concurrent registrations
41
+ — ~21 phantom containers during a webhook-driven burst at ~16:00-17:00 UTC on 2026-05-04).
42
+ fix: |
43
+ 1. Add exponential backoff to your registration token call (4 attempts, 2^n second delays).
44
+ 2. Stagger autoscaler spawns with per-container random jitter (0-10 seconds) to break up
45
+ concurrent registration bursts before they hit the endpoint simultaneously.
46
+ 3. Switch to JIT runner tokens — they are pre-assigned per job and do not require a burst-
47
+ sensitive registration token call:
48
+ POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig
49
+ 4. Reduce max_concurrent_spawns in your autoscaler to limit peak registration load.
50
+ 5. Implement phantom container detection: health-check containers shortly after spawn and
51
+ kill any that failed to register within N seconds.
52
+ fix_code:
53
+ - language: yaml
54
+ label: 'Python — retry-with-backoff on 502 when minting registration token'
55
+ code: |
56
+ import time, json, urllib.request, urllib.error
57
+
58
+ def mint_registration_token(owner, repo, github_token):
59
+ url = f"https://api.github.com/repos/{owner}/{repo}/actions/runners/registration-token"
60
+ headers = {
61
+ "Authorization": f"token {github_token}",
62
+ "Accept": "application/vnd.github+json",
63
+ "X-GitHub-Api-Version": "2022-11-28",
64
+ }
65
+ for attempt in range(4):
66
+ try:
67
+ req = urllib.request.Request(url, method="POST", headers=headers)
68
+ with urllib.request.urlopen(req, timeout=15) as resp:
69
+ return json.load(resp)["token"]
70
+ except urllib.error.HTTPError as e:
71
+ if 500 <= e.code < 600 and attempt < 3:
72
+ delay = 2 ** attempt # 1s, 2s, 4s
73
+ print(f"Registration token {e.code}, retrying in {delay}s (attempt {attempt+1}/4)...")
74
+ time.sleep(delay)
75
+ continue
76
+ raise
77
+ - language: yaml
78
+ label: 'Autoscaler — add random jitter per container spawn to break up burst'
79
+ code: |
80
+ import asyncio, random
81
+
82
+ async def handle_workflow_job_queued(event):
83
+ # Stagger spawns: random delay 0-10s reduces simultaneous token requests
84
+ jitter = random.uniform(0, 10)
85
+ await asyncio.sleep(jitter)
86
+ token = await mint_registration_token(owner, repo, github_token)
87
+ await spawn_ephemeral_container(token)
88
+ prevention:
89
+ - 'Add exponential backoff (4 attempts, 2^n seconds) for 5xx responses in all registration token calls.'
90
+ - 'Add random per-container spawn jitter (0-10s) in your autoscaler to break up concurrent registration bursts.'
91
+ - 'Switch to JIT runner tokens (generate-jitconfig) for burst autoscaler workloads — they do not hit the burst-sensitive registration endpoint.'
92
+ - 'Monitor for phantom containers: any container that does not show as registered within 60 seconds of spawn should be terminated.'
93
+ - 'Cap max_concurrent_spawns conservatively (≤10) and tune based on observed 502 rates.'
94
+ docs:
95
+ - url: 'https://github.com/actions/runner/issues/4399'
96
+ label: 'actions/runner#4399: Registration token endpoint returns 502 in bursts (May 2026)'
97
+ - url: 'https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository'
98
+ label: 'GitHub REST API: Create a registration token for a repository'
99
+ - url: 'https://docs.github.com/en/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository'
100
+ label: 'GitHub REST API: Create JIT runner config (avoids burst-sensitive registration token)'
101
+ - url: 'https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/autoscaling-with-self-hosted-runners'
102
+ label: 'GitHub Docs: Autoscaling with self-hosted runners'
@@ -0,0 +1,111 @@
1
+ id: runner-environment-183
2
+ title: "setup-java JAVA_HOME stripped by sudo env_reset on Ubuntu — wrong JDK used silently"
3
+ category: runner-environment
4
+ severity: silent-failure
5
+ tags:
6
+ - setup-java
7
+ - sudo
8
+ - java
9
+ - ubuntu
10
+ - env-reset
11
+ - sudoers
12
+ - java-home
13
+ patterns:
14
+ - regex: 'error: invalid target release: \d+'
15
+ flags: 'i'
16
+ - regex: '(bad source file|class file has wrong version).*\d+\.\d+'
17
+ flags: 'i'
18
+ error_messages:
19
+ - "error: invalid target release: 25"
20
+ - "error: invalid target release: 21"
21
+ - "error: invalid target release: 23"
22
+ - "class file has wrong version"
23
+ root_cause: |
24
+ Ubuntu's sudoers policy includes `env_reset` and `secure_path` by default. When a
25
+ workflow step runs any command via `sudo` (e.g., `sudo apt-get install ...`,
26
+ `sudo ant build`, `sudo mvn package`), the environment is completely reset: PATH
27
+ reverts to the sudoers secure_path and JAVA_HOME is cleared.
28
+
29
+ Because the runner image has JDK 17 registered as the system default via
30
+ `update-alternatives`, any subsequent Java invocation under sudo — including
31
+ tool-wrapped invocations via Debian-packaged `ant` (which uses `java-wrappers.sh`
32
+ to detect Java through system alternatives) — silently uses JDK 17 regardless of
33
+ what `actions/setup-java` configured.
34
+
35
+ This causes silent failures when the build silently compiles against JDK 17 and
36
+ produces wrong artifacts, and explicit errors when the requested JDK is newer
37
+ than 17 and javac refuses with "error: invalid target release: N".
38
+
39
+ The root cause is not a bug in setup-java — it correctly sets JAVA_HOME and PATH
40
+ via $GITHUB_ENV / $GITHUB_PATH, which only apply to non-sudo process contexts.
41
+ Ubuntu's sudoers env_reset is OS-level behaviour that strips those env variables.
42
+ fix: |
43
+ 1. Pass JAVACMD explicitly to sudo: `sudo JAVACMD=$JAVA_HOME/bin/java ant ...`
44
+ (Debian-packaged ant reads JAVACMD before system alternatives)
45
+ 2. Register the setup-java JDK as the system default before any sudo steps:
46
+ sudo update-alternatives --install /usr/bin/java java "$JAVA_HOME/bin/java" 2000
47
+ sudo update-alternatives --set java "$JAVA_HOME/bin/java"
48
+ 3. Avoid running Java build tools via sudo entirely — install build dependencies
49
+ first, then run the build as the runner user (without sudo).
50
+ 4. Use `sudo -E` to preserve the current environment (requires sudoers NOPASSWD
51
+ with env_keep or SETENV; not available by default on GitHub-hosted runners).
52
+ fix_code:
53
+ - language: yaml
54
+ label: "Workaround: pass JAVACMD explicitly to sudo ant/maven"
55
+ code: |
56
+ - name: Setup Java
57
+ uses: actions/setup-java@v4
58
+ with:
59
+ java-version: '25'
60
+ distribution: temurin
61
+
62
+ # Debian ant uses java-wrappers which ignores JAVA_HOME — pass JAVACMD directly
63
+ - name: Build with ant (sudo)
64
+ run: sudo JAVACMD=$JAVA_HOME/bin/java ant build
65
+
66
+ - language: yaml
67
+ label: "Workaround: register JDK as system default before sudo steps"
68
+ code: |
69
+ - name: Setup Java
70
+ uses: actions/setup-java@v4
71
+ with:
72
+ java-version: '25'
73
+ distribution: temurin
74
+
75
+ - name: Register JDK as system default (for sudo)
76
+ run: |
77
+ sudo update-alternatives --install /usr/bin/java java "$JAVA_HOME/bin/java" 2000
78
+ sudo update-alternatives --set java "$JAVA_HOME/bin/java"
79
+ sudo update-alternatives --install /usr/bin/javac javac "$JAVA_HOME/bin/javac" 2000
80
+ sudo update-alternatives --set javac "$JAVA_HOME/bin/javac"
81
+
82
+ - name: Build (sudo now uses correct JDK)
83
+ run: sudo ant build
84
+
85
+ - language: yaml
86
+ label: "Best practice: separate install from build to avoid sudo"
87
+ code: |
88
+ - name: Install build dependencies
89
+ run: sudo apt-get install -y build-essential
90
+
91
+ - name: Setup Java
92
+ uses: actions/setup-java@v4
93
+ with:
94
+ java-version: '25'
95
+ distribution: temurin
96
+
97
+ # No sudo here — JAVA_HOME is intact
98
+ - name: Build
99
+ run: ant build
100
+ prevention:
101
+ - "Avoid running Java build tools (ant, mvn, gradle) via sudo — install OS dependencies before setup-java, build without sudo"
102
+ - "After setup-java, verify sudo sees the correct JDK: sudo java -version"
103
+ - "For Debian-packaged tools (apt install ant), always pass JAVACMD=$JAVA_HOME/bin/java when invoking via sudo"
104
+ - "If sudo is unavoidable, register the JDK via update-alternatives immediately after setup-java"
105
+ docs:
106
+ - url: "https://github.com/actions/setup-java/issues/997"
107
+ label: "ubuntu-latest uses wrong JDK version under sudo (setup-java#997)"
108
+ - url: "https://github.com/actions/setup-java/pull/1013"
109
+ label: "Update README for Ubuntu sudo JAVA_HOME behavior (setup-java PR#1013)"
110
+ - url: "https://manpages.ubuntu.com/manpages/noble/en/man5/sudoers.5.html"
111
+ label: "sudoers(5) — env_reset and secure_path"
@@ -0,0 +1,98 @@
1
+ id: runner-environment-184
2
+ title: "setup-python free-threaded Python (3.13t/3.14t) on windows-11-arm64 installs broken 0-byte python.exe symlink"
3
+ category: runner-environment
4
+ severity: error
5
+ tags:
6
+ - setup-python
7
+ - free-threaded
8
+ - python
9
+ - windows-11-arm64
10
+ - symlink
11
+ - arm64
12
+ - reparse-point
13
+ patterns:
14
+ - regex: 'Fatal Python error: Failed to import encodings module'
15
+ flags: 'i'
16
+ - regex: 'ModuleNotFoundError: No module named .encodings.'
17
+ flags: 'i'
18
+ - regex: 'Remove-Item.*python\.exe.*does not exist'
19
+ flags: 'i'
20
+ error_messages:
21
+ - "Fatal Python error: Failed to import encodings module"
22
+ - "ModuleNotFoundError: No module named 'encodings'"
23
+ - "Remove-Item : Cannot find path '...\\arm64-freethreaded\\python.exe' because it does not exist."
24
+ - "Error happened during pip installation / upgrade"
25
+ root_cause: |
26
+ The `win32-arm64-freethreaded` distribution zip for Python 3.13t and 3.14t packages
27
+ `python.exe` and `python3.exe` as Windows reparse points (symlinks) pointing to
28
+ `python3.13t.exe` / `python3.14t.exe`.
29
+
30
+ When actions/setup-python extracts and copies the zip contents to the tool cache on
31
+ `windows-11-arm64`, the symlink target is not found at the expected relative path —
32
+ the copy operation leaves a dangling 0-byte reparse point (`-a---l 0 python.exe`)
33
+ instead of a real executable.
34
+
35
+ `setup.ps1:131` then fails to Remove-Item the dangling reparse point (PowerShell
36
+ cannot delete it because the path resolves as non-existent), and the tool cache
37
+ entry has no working Python interpreter. When the action invokes the installed
38
+ python, it immediately crashes with "Fatal Python error: Failed to import encodings
39
+ module" because the 0-byte stub cannot locate its stdlib.
40
+
41
+ Non-free-threaded arm64 builds (3.11, 3.12, 3.13, 3.14) are not affected — only
42
+ the `*t` (free-threaded / GIL-free) variants hit this issue on windows-11-arm64.
43
+ fix: |
44
+ 1. Workaround: Use the non-free-threaded variant (3.13 instead of 3.13t) unless
45
+ the GIL-free runtime is explicitly required.
46
+ 2. Workaround for arm64 only: Install free-threaded Python from NuGet, which
47
+ ships real executables instead of symlinks. Gate on runner.arch == 'ARM64'.
48
+ 3. Wait for actions/setup-python to land a fix that correctly resolves Windows
49
+ reparse points in free-threaded zip distributions (tracked in setup-python#1307).
50
+ fix_code:
51
+ - language: yaml
52
+ label: "Workaround: use non-free-threaded Python on windows-11-arm64"
53
+ code: |
54
+ - uses: actions/setup-python@v5
55
+ with:
56
+ # Avoid '3.13t' / '3.14t' on windows-11-arm64 — use standard variant
57
+ python-version: '3.13'
58
+
59
+ - language: yaml
60
+ label: "Workaround: install free-threaded Python via NuGet on ARM64"
61
+ code: |
62
+ - name: Setup Python (non-ARM64)
63
+ if: runner.arch != 'ARM64'
64
+ uses: actions/setup-python@v5
65
+ with:
66
+ python-version: '3.13t'
67
+
68
+ - name: Install free-threaded Python via NuGet (windows-11-arm64 workaround)
69
+ if: runner.os == 'Windows' && runner.arch == 'ARM64'
70
+ run: |
71
+ nuget install python -Version 3.13.3t -OutputDirectory "$env:RUNNER_TEMP\nuget" -NonInteractive
72
+ $pythonDir = Get-ChildItem "$env:RUNNER_TEMP\nuget" -Filter "python.3*" | Select-Object -First 1
73
+ Add-Content $env:GITHUB_PATH "$($pythonDir.FullName)\tools"
74
+ Add-Content $env:GITHUB_PATH "$($pythonDir.FullName)\tools\Scripts"
75
+
76
+ - language: yaml
77
+ label: "Verification step: confirm Python works after setup"
78
+ code: |
79
+ - uses: actions/setup-python@v5
80
+ with:
81
+ python-version: '3.13t'
82
+
83
+ - name: Verify Python installation
84
+ run: |
85
+ python --version
86
+ python -c "import sys; print(sys.version, sys._is_gil_enabled())"
87
+ prevention:
88
+ - "Do not use free-threaded Python variants (3.13t, 3.14t) on windows-11-arm64 until setup-python#1307 is resolved"
89
+ - "Gate free-threaded Python tests: run on ubuntu-latest or windows-latest (x64), avoid windows-11-arm64 for *t variants"
90
+ - "Add a verification step (python -c 'import sys') after setup-python to catch broken installs before test steps"
91
+ - "Follow setup-python#1307 for the official fix — upgrade as soon as a patched version is released"
92
+ docs:
93
+ - url: "https://github.com/actions/setup-python/issues/1307"
94
+ label: "setup-python fails for free-threaded Python (3.13t/3.14t) on windows-11-arm64 (setup-python#1307)"
95
+ - url: "https://github.com/onnx/onnx/pull/7869"
96
+ label: "Install free-threaded Python from NuGet on windows-11-arm (workaround reference)"
97
+ - url: "https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython"
98
+ label: "Python 3.13 — Free-threaded CPython documentation"