Skip to content

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

Open
@Vampire

Description

@Vampire

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 actions/runner-images#10563 done.

Activity

ssbarnea

ssbarnea commented on Feb 13, 2025

@ssbarnea
>where wsl
C:\Users\runner\AppData\Local\Microsoft\WindowsApps\wsl.exe
C:\Windows\System32\wsl.exe

First one is a symlink, second one is an executable. It is a bit confusing to see an error with the uppercase extension (as most FS outside Windows world are case-sensitive).

I suspect that we could remove the symlink as both locations are in PATH to avoid the error, but I still think that the error should not happen because Windows does allow execution of the symlink without any problems, so the stat check is broken, it should pass.

I raised #1953 which should fix the issue but considering that nobody looked at the issue so far and that they don't even run the CI w/o approval,... it might take a lot of time to get someone attention.

With a bit of luck maybe @thboop, @luketomlinson or @Link- might see #1953 and review it.

added a commit that references this issue on Feb 13, 2025
b2444c0
added a commit that references this issue on Feb 24, 2025

Work around actions/toolkit#1925 better and more completely

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @ssbarnea@Vampire

      Issue actions

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