actions / actions/toolkit

"EACCES: permission denied" if additional executable with same name appears on `PATH` when using `@actions/exec`

Open
#1,925 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

I use @actions/exec in my setup-wsl GitHub Actions action to do various tool runs.

One of the tools that is run is wsl.
To use WSLv2 on windows-2022 currently, you have to do a wsl --update first.
To use any version of WSLv2 on windows-2025 currently, you have to do a wsl --install --no-distribution first.

Both of these commands add an addtional wsl.exe link to C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps - which is on the PATH - that was not there before.

If you now use exec() to run a wsl command, you always get

Unexpected error attempting to determine if executable file exists 'C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps\wsl.EXE': Error: EACCES: permission denied, stat 'C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps\wsl.EXE'

spamming the build output.

To reproduce, first do a wsl --update through exec(), then a wsl --status through exec() on a windows-2022 image that does not yet have https://github.com/actions/runner-images/issues/10563 done.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sequence in @actions/exec on a windows-2022 image: run wsl --update through exec(), then wsl --status. Inspect the executable existence check that reports the EACCES error; done means the second command runs without spamming this permission-denied message.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.