erlef / setup-beam

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

Setup hangs on mix local.rebar,--force #277

Closed teamon closed 4 months ago

teamon commented 4 months ago

The bug

Since yesterday the action hangs on Running mix local.rebar,--force and gets cancelled only after 360 minutes. Updating erlang/elixir versions or rerunning the job does not solve it.

Here is a log that timed out: ``` Prepare all required actions Getting action download info Download action repository 'erlef/setup-beam@v1' (SHA:2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c) Download action repository 'actions/cache@v4' (SHA:0c45773b623bea8c8e75f6c82b208c3cf94ea4f9) Run ./.github/actions/setup-elixir env: MIX_ENV: test Run erlef/setup-beam@v1 with: version-file: .tool-versions version-type: strict github-token: *** install-hex: true install-rebar: true disable_problem_matchers: false hexpm-mirrors: https://builds.hex.pm env: MIX_ENV: test Parsing version file at .tool-versions Consuming erlang at version 26.2.2 Consuming elixir at version 1.16.1-otp-26 ... done! Installing Erlang/OTP OTP-26.2.2 - built on ubuntu-22.04 /usr/bin/tar zx --strip-components=1 --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/cdc80366-f8c5-434a-b782-c9bb61fe43be -f /home/runner/work/_temp/6519f13c-3b61-444b-ba2b-e0982c390093 /home/runner/work/_temp/.setup-beam/otp/Install -minimal /home/runner/work/_temp/.setup-beam/otp Installed Erlang/OTP version /home/runner/work/_temp/.setup-beam/otp/bin/erl -version Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 14.2.2 Using Elixir 1.16.1 (built for Erlang/OTP 26) Installing Elixir v1.16.1-otp-26 /usr/bin/unzip -o -q /home/runner/work/_temp/14e59ea3-06e5-4d84-90ce-987aec05aeb9 Installed Elixir version /home/runner/work/_temp/.setup-beam/elixir/bin/elixir -v Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns] Elixir 1.16.1 (compiled with Erlang/OTP 26) Running mix local.rebar,--force /home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force Mix requires the Hex package manager to fetch dependencies Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] Error: The operation was canceled. ```
Here is a (part of) log with debug enabled that is still running right now ``` ##[debug]Caching tool otp ubuntu-22.04/OTP-26.2.5 x64 ##[debug]source dir: /home/runner/work/_temp/460f48b1-c42e-4c42-a492-1afe895f9f46 ##[debug]destination /opt/hostedtoolcache/otp/ubuntu-22.04/OTP-26.2.5/x64 ##[debug]finished caching tool ##[debug]Performing post extract operations... /home/runner/work/_temp/.setup-beam/otp/Install -minimal /home/runner/work/_temp/.setup-beam/otp ##[debug]Adding /home/runner/work/_temp/.setup-beam/otp' bin to system path ##[debug]Exporting INSTALL_DIR_FOR_OTP as /home/runner/work/_temp/.setup-beam/otp Installed Erlang/OTP version /home/runner/work/_temp/.setup-beam/otp/bin/erl -version Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 14.2.5 ::endgroup:: Using Elixir 1.16.3 (built for Erlang/OTP 26) ::group::Installing Elixir v1.16.3-otp-26 Installing Elixir v1.16.3-otp-26 ::group::Running mix local.rebar,--force Running mix local.rebar,--force /home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force Mix requires the Hex package manager to fetch dependencies ```

Software versions

A list of software versions where the bug is apparent, as detailed as possible:

How to replicate

Might be hard since I don't know what's the cause, but using the config above should at least try to replicate it.

Expected behaviour

That it doesn't hang 🙃

At this point I don't know if this is even setup-beam problem or GitHub (status page says everything is fine) but maybe someone will know.

paulo-ferraz-oliveira commented 4 months ago

@teamon, I'm going to test this over at https://github.com/paulo-ferraz-oliveira/setup-beam-example.

paulo-ferraz-oliveira commented 4 months ago

Your log mentions Elixir 1.16.1 (compiled with Erlang/OTP 26) but your .tool-versions is for Elixir 1.16.3:

Installing Elixir v1.16.1-otp-26
  /usr/bin/unzip -o -q /home/runner/work/_temp/14e59ea3-06e5-4d84-90ce-987aec05aeb9
  Installed Elixir version
  /home/runner/work/_temp/.setup-beam/elixir/bin/elixir -v
  Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

  Elixir 1.16.1 (compiled with Erlang/OTP 26)
         ^
paulo-ferraz-oliveira commented 4 months ago

I'm going to update my test .tool-versions to run with the same versions your log mentions.

Note: running with your example steps I get no error and the action is not blocked.

paulo-ferraz-oliveira commented 4 months ago

I cannot replicate the issue. Feel free to setup a minimal repo, as I did, to test it out, and we can go from there. Thanks.

teamon commented 4 months ago

Ah, I forgot to mention I updated the elixir version between first and second run.

Thank you for checking, I’ll try to setup some publicly available reproduction.

💜

teamon commented 4 months ago

I've setup a separete repo with the same workflow steps and it worked just fine.

image

I've deleted all cache but that didn't help.

The difference in log is:

The bad one:

Running mix local.rebar,--force
  /home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
  Mix requires the Hex package manager to fetch dependencies

The good one:

Running mix local.rebar,--force
  /home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
  * creating /home/runner/.mix/elixir/1-16/rebar3

Does this give any hints on what could be going on here?

teamon commented 4 months ago

I've found out that removing my mix.exs file helps, however if I copy the same mix.exs/mix.lock to the empty repo it works just fine.

I managed to replicate the issues with act locally, I'll dig some more.

image
teamon commented 4 months ago

Seems like the problem is with --force flag being ignored, even when I run this locally:

❯ mix local.hex --force
Mix requires the Hex package manager to fetch dependencies
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] 
teamon commented 4 months ago

Turns out this was all due to my config/config.exs: https://github.com/elixir-lang/elixir/issues/13617#issuecomment-2136892299

paulo-ferraz-oliveira commented 4 months ago

Glad it got solved. And now we have good references for when something similar happens to other people 😄