erlef / setup-beam

Set up your BEAM-based GitHub Actions workflow (Erlang, Elixir, Gleam, ...)
MIT License
373 stars 50 forks source link

Error: Unable to locate executable file: unzip on self-hosted runner #263

Closed davidahmed closed 4 months ago

davidahmed commented 4 months ago

The bug

I switched from Github runners to self-hosted runners. All actions work by default, however, the following action fails:

jobs:
  build:
    ...
    steps:
      - ...
      - name: Set up Elixir
        id: setup-beam
        uses: erlef/setup-beam@v1
        with:
          elixir-version: '1.16.2' # [Required] Define the Elixir version
          otp-version: '26.2.3'    # [Required] Define the Erlang/OTP version

Here's the detailed log that running erlef/setup-beam@v1 leaves when it runs on the self-hosted runner:

Installing Erlang/OTP OTP-26.2.3 - built on ubuntu-22.04
  /usr/bin/tar zx --strip-components=1 --warning=no-unknown-keyword --overwrite -C /home/ubuntu/actions-runner/_work/_temp/8d1c0d8d-0cc8-4d33-8489-825ba534c948 -f /home/ubuntu/actions-runner/_work/_temp/817b4333-aba8-42f5-8215-7a210d540ecd
  /home/ubuntu/actions-runner/_work/_temp/.setup-beam/otp/Install -minimal /home/ubuntu/actions-runner/_work/_temp/.setup-beam/otp
  Installed Erlang/OTP version
  /home/ubuntu/actions-runner/_work/_temp/.setup-beam/otp/bin/erl -version
  Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 14.2.3
Using Elixir 1.16.2 (built for Erlang/OTP 26)
Installing Elixir v1.16.2-otp-26
  Action install Elixir v1.16.2-otp-26 failed for mirror https://builds.hex.pm,/ with Error: Unable to locate executable file: unzip. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
  Error: Could not install Elixir v1.16.2-otp-26 from any hex.pm mirror

Software versions

The host machine where the self-hosted runner is running is ubuntu-22.04. I have additionally pre-ambled my Github workflow file as:

jobs:
  build:
    name: Build and test
    runs-on: self-hosted
    env:
      ImageOS: ubuntu22        # See https://github.com/erlef/setup-beam/issues/58

Expected behaviour

I was expecting that migrating this workflow would just work. The error also doesn't help understand what the actual issue is.

davidahmed commented 4 months ago

I've additionally tried this idea as well, but I end up with the same error:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: erlef/setup-beam@v1
        with:
          otp-version: '26'
          hexpm-mirrors: |
            https://builds.hex.pm
            https://cdn.jsdelivr.net/hex
paulo-ferraz-oliveira commented 4 months ago

👋 I think the important bit is "Unable to locate executable file: unzip". You should have the executable in the execution path of the action. I don't know where this is called, but don't recall calling unzip explicitly.

paulo-ferraz-oliveira commented 4 months ago

Closing as this doesn't seem to be action-specific. Feel free to reopen if you think otherwise.