Skip to content

CI: PowerShell startup intermittently fails with procargs errno 5 on macOS #12652

Open

Description

@simonrozsival

Android framework version

N/A — this is an Azure Pipelines agent/PowerShell startup failure that occurs before the test-slicing script runs.

Affected platform version

Azure Pipelines macOS agent in the MSBuild Emulator Tests macOS > MSBuild+Emulator 7 lane.

Observed in public build 1579507, task Slice unit tests with filter.

Description

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.

  1. Run the public dotnet-android pipeline on the macOS hosted agents.
  2. Observe the Slice unit tests with filter PowerShell task in an MSBuild emulator lane.
  3. 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.

Activity

  1. added
    needs-triage
    flaky-ci
    on Sep 3, 2026
  2. added this to the .NET 12 milestone on Nov 19, 2026
  3. removed
    needs-triage
    on Nov 19, 2026
  4. simonrozsival commented on Nov 22, 2026

    @simonrozsival
    MemberAuthor

    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 ....

    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.

  5. simonrozsival commented on Nov 22, 2026

    @simonrozsival
    MemberAuthor

    Related reports and mitigation:

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky-ci

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions