You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI: PowerShell startup intermittently fails with procargs errno 5 on macOS #12652
The PowerShell@2 task failed while starting PowerShell, before executing the test-slicing script. The startup path reported a failed macOS procargs call (errno 5) and threw Microsoft.PowerShell.ManagedPSEntry+StartupException.
This appears to be an intermittent hosted-agent/process-startup failure rather than a test failure. It made the MSBuild+Emulator 7 CI lane fail without running its assigned tests.
Steps to Reproduce
No deterministic local reproduction is currently known.
Run the public dotnet-android pipeline on the macOS hosted agents.
Observe the Slice unit tests with filter PowerShell task in an MSBuild emulator lane.
In the affected run, PowerShell fails during startup before the script executes.
Did you find any workaround?
Rerun the affected CI job or pipeline.
Relevant log output
Call to 'procargs' failed with errno 5
Microsoft.PowerShell.ManagedPSEntry+StartupException
PowerShell exited with code 'null'.
The failure occurred in build 1579507, MSBuild Emulator Tests macOS > MSBuild+Emulator 7 > Slice unit tests with filter.
Call to 'procargs' failed with errno 5
Unhandled exception. Microsoft.PowerShell.ManagedPSEntry+StartupException
at Microsoft.PowerShell.ManagedPSEntry.ThrowOnFailure(String call, Int32 code)
at Microsoft.PowerShell.ManagedPSEntry.AttemptExecPwshLogin(String[] args)
at Microsoft.PowerShell.ManagedPSEntry.Main(String[] args)
PowerShell exited with code 'null'.
The same set JDK variables step succeeded in 33 other jobs and failed in this one. The subsequent artifact-upload error, Path does not exist: /Users/runner/work/1/a/TestRelease, is downstream of the early failure, not the primary cause.
This confirms the issue is not confined to test slicing or test-result processing: other macOS PowerShell steps can fail before their scripts execute. Automatic recovery must therefore operate outside PowerShell. Any retry should be bounded, preserve genuine script failures, and account for side effects if it retries failures beyond this startup-only signature. Prior attempt #13400 was closed without merging and covered only test processing.
The MAUI workaround depends on an undocumented PowerShell implementation detail. PowerShell consumes the variable on startup, so nested pwsh launches are not automatically protected; its effect on login-shell behavior and variable injection should be verified before applying it here.
Activity
simonrozsival commentedon Nov 22, 2026
Another occurrence in public build 1693717, on 2026-11-21, in macOS > Tests > MSBuild+Emulator 7 > set JDK variables (GitHub check).
PowerShell task version:
2.283.0. Invocation:/usr/local/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command ....The same
set JDK variablesstep succeeded in 33 other jobs and failed in this one. The subsequent artifact-upload error,Path does not exist: /Users/runner/work/1/a/TestRelease, is downstream of the early failure, not the primary cause.This confirms the issue is not confined to test slicing or test-result processing: other macOS PowerShell steps can fail before their scripts execute. Automatic recovery must therefore operate outside PowerShell. Any retry should be bounded, preserve genuine script failures, and account for side effects if it retries failures beyond this startup-only signature. Prior attempt #13400 was closed without merging and covered only test processing.
simonrozsival commentedon Nov 22, 2026
Related reports and mitigation:
procargserrno 5 startup failure.__PWSH_LOGIN_CHECKED=1in its common pipeline variables to skip PowerShell’s login-shell detection path.The MAUI workaround depends on an undocumented PowerShell implementation detail. PowerShell consumes the variable on startup, so nested
pwshlaunches are not automatically protected; its effect on login-shell behavior and variable injection should be verified before applying it here.[ci] Avoid macOS PowerShell startup failures (#13709)