Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.141.0 break my workflow #475

Closed
2 tasks done
alejandraRamos opened this issue Mar 3, 2023 · 7 comments · Fixed by #476
Closed
2 tasks done

Version 1.141.0 break my workflow #475

alejandraRamos opened this issue Mar 3, 2023 · 7 comments · Fixed by #476

Comments

@alejandraRamos
Copy link

alejandraRamos commented Mar 3, 2023

Ensure the following before filing this issue

  • I verified it reproduces with the latest version with - uses: ruby/setup-ruby@v1 (see Versioning policy)

  • I tried to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for Downloading Ruby & Extracting Ruby),
    and it did not reproduce locally (if it does reproduce locally, it's not a ruby/setup-ruby issue)

Are you running on a GitHub-hosted runner or a self-hosted runner?

self-hosted runner

The workflow code or a link to the workflow file

- name: Set up Ruby
  uses: ruby/setup-ruby@v1
  with:
    ruby-version: 3.2.0

Link to the log of a failed workflow job, or to a gist with the output

Error: The current runner (ubuntu-22.04-x64, RUNNER_TOOL_CACHE=/opt/actions-runner/_work/_tool) was detected as self-hosted because the $RUNNER_TOOL_CACHE is different than the default tool cache path (they must be the same to reuse prebuilt Ruby binaries).

The command and output of the failing step

Run ruby/setup-ruby@v1
  with:
    ruby-version: 3.2.0
    bundler-cache: false
  env:
    ImageOS: ubuntu22
Error: The current runner (ubuntu-22.04-x64, RUNNER_TOOL_CACHE=/opt/actions-runner/_work/_tool) was detected as self-hosted because the $RUNNER_TOOL_CACHE is different than the default tool cache path (they must be the same to reuse prebuilt Ruby binaries).

Any other notes?

This change damaged the performance of my workflow. I run workflow on Self hosted runners
image

@meceonzo
Copy link

meceonzo commented Mar 3, 2023

I am seeing this as well, and it is breaking a critical workflow. I do not have access to install ruby in the runner myself.

@bplexico
Copy link

bplexico commented Mar 4, 2023

We're seeing the same issue. The only difference for us is the ubuntu version.

(ubuntu-20.04-x64, RUNNER_TOOL_CACHE=/opt/actions-runner/_work/_tool)

We're running Github Enterprise internally.

@jordanenglish
Copy link

Same issue here.

We used the following as a workaround to get critical workflows running again.

uses: ruby/setup-ruby@v1.139.0

@eregon
Copy link
Member

eregon commented Mar 5, 2023

Thanks for the report.
This conflicts with #242 though.

Previously this only worked accidentally, in fact I guess your runner would download the prebuilt Ruby every single time, which was never intended (it should get cached in the tool cache for self-hosted). Because looking in the runner toolcache would not find anything since the runner toolcache doesn't have the same path as GitHub-hosted runner toolcaches.

Is RUNNER_TOOL_CACHE=/opt/actions-runner/_work/_tool the default for self-hosted runners, or is it some path you chose?

@eregon
Copy link
Member

eregon commented Mar 5, 2023

I guess I'll need to revert 377a94b so these "self-hosted runners" which happen to match a github-hosted runner image but have their RUNNER_TOOL_CACHE set to something else still work somewhat as they did before.

@eregon
Copy link
Member

eregon commented Mar 5, 2023

Previously this only worked accidentally, in fact I guess your runner would download the prebuilt Ruby every single time, which was never intended (it should get cached in the tool cache for self-hosted).

Actually it's worse than that, on every workflow execution it would also remove that Ruby and redownload and extract it. Which leads to problems such as #191 if two workflows using setup-ruby would ever run in parallel.

eregon added a commit to eregon/setup-ruby that referenced this issue Mar 5, 2023
* So it finds already-download prebuilt Ruby in the GH-hosted tool cache path
  on self-hosted, where $RUNNER_TOOL_CACHE is often different than on GH-hosted.
* See ruby#475.
eregon added a commit to eregon/setup-ruby that referenced this issue Mar 5, 2023
eregon added a commit to eregon/setup-ruby that referenced this issue Mar 5, 2023
* So it finds already-download prebuilt Ruby in the GH-hosted tool cache path
  on self-hosted, where $RUNNER_TOOL_CACHE is often different than on GH-hosted.
* See ruby#475.
eregon added a commit to eregon/setup-ruby that referenced this issue Mar 5, 2023
* So it finds already-download prebuilt Ruby in the GH-hosted tool cache path
  on self-hosted, where $RUNNER_TOOL_CACHE is often different than on GH-hosted.
* See ruby#475.
* This relies on tc.find() looking up the env var every time:
  https://github.com/actions/toolkit/blob/1f4b3fac06/packages/tool-cache/src/tool-cache.ts#L522
eregon added a commit that referenced this issue Mar 5, 2023
eregon added a commit that referenced this issue Mar 5, 2023
* So it finds already-download prebuilt Ruby in the GH-hosted tool cache path
  on self-hosted, where $RUNNER_TOOL_CACHE is often different than on GH-hosted.
* See #475.
* This relies on tc.find() looking up the env var every time:
  https://github.com/actions/toolkit/blob/1f4b3fac06/packages/tool-cache/src/tool-cache.ts#L522
@eregon
Copy link
Member

eregon commented Mar 5, 2023

Should be fixed in https://github.com/ruby/setup-ruby/releases/tag/v1.142.0.
TBH I never wanted to support self-hosted runners with this action, it's a ton of extra complications.
This action might stop supporting them at some point entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants