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

Unable to resolve v1: reference not found #311

Closed
MartinGonzalez opened this issue Jul 20, 2020 · 28 comments
Closed

Unable to resolve v1: reference not found #311

MartinGonzalez opened this issue Jul 20, 2020 · 28 comments
Labels

Comments

@MartinGonzalez
Copy link

Hi!
It's the first time I'm working with github actions and I saw this to test them locally.

I have this workflow

name: Test-Build-Publish

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/cache@v1
      with:
        path: vendor/bundle
        key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile') }}
        restore-keys: |
          ${{ runner.os }}-gem-
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 2.4
    - name: Install dependencies
      run: bundle check || bundle install --jobs=4 --retry=3 --path vendor/bundle
    - name: Run tests
      run: bundle exec rake
    - name: Upload artifact
      uses: actions/upload-artifact@v2
      with:
        name: test-results
        path: test-results
  build:
    name: "Build Gem"
    needs: test
    runs-on: ubuntu-20.04
    steps:
    - name: Build
      run: echo 'building'
  publish:
    name: Publish Gem
    needs: build
    runs-on: ubuntu-20.04
    steps:
    - name: Publish
      run: echo 'publish'

But I'm having this error when running act

➜  fastlane-plugin-json git:(master) act
[Test-Build-Publish/test       ] 🚀  Start image=node:12.6-buster-slim
[Test-Build-Publish/test       ]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test-Build-Publish/test       ]   🐳  docker cp src=/Users/martin.gonzalez/Desktop/fastlane-plugin-json/. dst=/github/workspace
[Test-Build-Publish/test       ] ⭐  Run actions/checkout@v2
[Test-Build-Publish/test       ]   ✅  Success - actions/checkout@v2
[Test-Build-Publish/test       ] ⭐  Run actions/cache@v1
[Test-Build-Publish/test       ]   ☁  git clone 'https://github.com/actions/cache' # ref=v1
[Test-Build-Publish/test       ]   🐳  docker cp src=/Users/martin.gonzalez/.cache/act/actions-cache@v1 dst=/actions/
[Test-Build-Publish/test       ]   💬  ::debug::Cache Path: /github/workspace/vendor/bundle
[Test-Build-Publish/test       ]   ❓  ::save-state name=CACHE_KEY,::Linux-gem-df84e4ade202d5cd4280a79acfea544a600ef73f1b39b2097a1f660ed64dd2a7
[Test-Build-Publish/test       ]   💬  ::debug::Resolved Keys:
[Test-Build-Publish/test       ]   💬  ::debug::["Linux-gem-df84e4ade202d5cd4280a79acfea544a600ef73f1b39b2097a1f660ed64dd2a7","Linux-gem-"]
[Test-Build-Publish/test       ]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[Test-Build-Publish/test       ]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache.
| [warning]getCacheEntry failed: Cache Service Url not found, unable to restore cache.
[Test-Build-Publish/test       ]   ⚙  ::set-output:: cache-hit=false
[Test-Build-Publish/test       ]   ✅  Success - actions/cache@v1
[Test-Build-Publish/test       ] ⭐  Run Set up Ruby
[Test-Build-Publish/test       ]   ☁  git clone 'https://github.com/ruby/setup-ruby' # ref=v1
[Test-Build-Publish/test       ] Unable to resolve v1: reference not found
[Test-Build-Publish/test       ]   ❌  Failure - Set up Ruby
Error: reference not found

If I run git clone 'https://github.com/ruby/setup-ruby' # ref=v1 it succeed. Should I configure something? A github token to an Env variable or something?

@jean-francois-labbe
Copy link

I have the same issue

@thelfensdrfer
Copy link

thelfensdrfer commented Jul 27, 2020

This usually means that the version, in your case v1, does not exist. You can try e.g. uses: ruby/[email protected].

@PsypherPunk
Copy link

I'm seeing something similar using actions-rs/toolchain@v1. If pushed to Github, the Action works as intended; running act locally, I see Unable to resolve v1: reference not found.

If I change this to actions-rs/[email protected] then act works as expected.

As far as I can see, both v1.0.6 and v1 are valid references: https://github.com/actions-rs/toolchain/tags

@plauche
Copy link

plauche commented Jul 30, 2020

I'm seeing a similar issue but when using @HEAD as the ref which should generally be valid in a git repo. Works fine when deployed to GH actions.

@drewcoo
Copy link

drewcoo commented Jul 31, 2020

I'm seeing this failure in Act but not on GitHub, too.
I'm using cypress-io/github-action.
Using @v2 works on GitHub.
The repo does not have a v2 tag, so that fails with reference not found.
It had a v2.2.2 tag, which Act can find, but then it fails with this:

[web redesign functional test/tryit-2] Exec command '[node \actions\[email protected]\dist\index.js]'
| internal/modules/cjs/loader.js:628
| throw err;
| ^
|
| Error: Cannot find module '/github/workspace/\actions\[email protected]\dist\index.js'
| at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
| at Function.Module._load (internal/modules/cjs/loader.js:527:27)
| at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
| at internal/main/run_main_module.js:17:11 {
| code: 'MODULE_NOT_FOUND',
| requireStack: []
| }

(marking the output above as code mangled it badly, so I bolded instead)

@joerodrig
Copy link

I was having this issue as well on Act. I got around it by forking the repo and creating a new tag off of the head of the latest release(v1.40.0) and creating a new tag that was just v1, which was recognized. See this release tag. My guess is that this parser code is looking for a base version tag(ie. v1), which it's not finding because the base v1 tag here is v1.0.0

I'm not 100% sure if this worked as a full workaround though, because I'm getting a new issue when attempting to install my specified ruby version now:

[Rails Unit Tests/build]   ❓  ::group::Extracting Ruby
| [command]/bin/tar -xz -C /github/home/.rubies -f /tmp/e24aa2b2-f52a-435c-9cde-66bd2b89b387
| Took   0.25 seconds
[Rails Unit Tests/build]   ❓  ::endgroup::
[Rails Unit Tests/build]   ⚙  ::set-env:: PATH=/github/home/.rubies/ruby-2.6.6/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[Rails Unit Tests/build]   ❓  ::group::Installing Bundler
| Using Bundler 2 from Gemfile.lock BUNDLED WITH 2.1.4
| [command]/github/home/.rubies/ruby-2.6.6/bin/gem install bundler -v ~> 2 --no-document
| Took   0.00 seconds
[Rails Unit Tests/build]   ❓  ::endgroup::
[Rails Unit Tests/build]   ❗  ::error::There was an error when attempting to execute the process '/github/home/.rubies/ruby-2.6.6/bin/gem'. This may indicate the process failed to start. Error: spawn /github/home/.rubies/ruby-2.6.6/bin/gem ENOENT
[Rails Unit Tests/build]   ❌  Failure - joerodrig/setup-ruby@v1

@mossad-zika
Copy link

cmon, fix it please

@pezholio
Copy link

@joerodrig Yep, I'm having exactly the same problem. It worked the first couple of times specifying the full tag, but now I'm getting that same error

@marartner
Copy link

marartner commented Sep 15, 2020

same issue with symfonycorp/security-checker-action@v2 - working fine on github itself, definitely exists. but locally:

[symfony-security-check/symfony]   ☁  git clone 'https://github.com/symfonycorp/security-checker-action' # ref=v2
[symfony-security-check/symfony] Unable to resolve v2: reference not found

doing symfonycorp/security-checker-action@038cecb1ee1bf871d1ef43e873f813d900a1125c (038... being the exact commit that tag is on) works. but that ofc shouldn't be a long term solution...

@askoriy
Copy link

askoriy commented Oct 5, 2020

The issue occurs if v1, v2 refs are branches, not tags. But yes, it's very annoying and needs to be fixed.

The same is #234

@cplee could you look into? Thanks so much

@bndynet
Copy link

bndynet commented Nov 11, 2020

I'm seeing something similar using actions-rs/toolchain@v1. If pushed to Github, the Action works as intended; running act locally, I see Unable to resolve v1: reference not found.

If I change this to actions-rs/[email protected] then act works as expected.

As far as I can see, both v1.0.6 and v1 are valid references: https://github.com/actions-rs/toolchain/tags

I used the exact version and resolved.

@akoshulian-exos
Copy link

I'm seeing something similar using actions-rs/toolchain@v1. If pushed to Github, the Action works as intended; running act locally, I see Unable to resolve v1: reference not found.
If I change this to actions-rs/[email protected] then act works as expected.
As far as I can see, both v1.0.6 and v1 are valid references: https://github.com/actions-rs/toolchain/tags

I used the exact version and resolved.

It works the first time after changing to the full version. On the second time, I get the same error.

@rna
Copy link

rna commented Jan 3, 2021

Is anyone found a fix for ruby setup: Error: reference not found

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

@tonyaajjackson
Copy link

Seeing the same issue with the setup-python action:

[Tests/build-3] ⭐  Run Set up Python ${{ matrix.python-version }}
[Tests/build-3]   ☁  git clone 'https://github.com/actions/setup-python' # ref=v1
[Tests/build-3] Unable to resolve v1: reference not found

Running git clone 'https://github.com/actions/setup-python' # ref=v1 locally is successful.

Github actions yaml file can be found here:
https://github.com/plamere/spotipy/blob/master/.github/workflows/pythonapp.yml

@ps-brandmonitor
Copy link

Is anyone found a fix for ruby setup: Error: reference not found

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

I did:

uses: ruby/[email protected]

That seemed to do the trick!

@rna
Copy link

rna commented Jan 13, 2021

Now, I'm getting this new error after changing as per your suggestion. @ps-rruiz

[Rails Tests/RSpec] ⭐  Run actions/checkout@v2
[Rails Tests/RSpec]   ✅  Success - actions/checkout@v2
[Rails Tests/RSpec] ⭐  Run ruby/[email protected]
[Rails Tests/RSpec]   ☁  git clone 'https://github.com/ruby/setup-ruby' # ref=v1.62.0
[Rails Tests/RSpec]   🐳  docker cp src=/home/ramesh/.cache/act/[email protected] dst=/actions/
[Rails Tests/RSpec]   ❗  ::error::The environment variable ImageOS must be set
[Rails Tests/RSpec]   ❌  Failure - ruby/[email protected]
Error: exit with `FAILURE`: 1

@catthehacker
Copy link
Member

catthehacker commented Jan 13, 2021

@rna specify OS version in env file e.g.: ImageOS=ubuntu18 and use it via --env-file flag

@lufia
Copy link
Contributor

lufia commented Jan 15, 2021

I added commits on #471 and #433 and they were merged (but they aren't released yet), so I'm expecting this issue will be fixed.

@theowenyoung
Copy link
Contributor

@cplee may I know when to release next version? This fix really helps.

@cplee
Copy link
Contributor

cplee commented Jan 23, 2021

@theowenyoung - just released v0.2.19

@yuuuxt
Copy link

yuuuxt commented Jan 23, 2021

It's working in Windows 10 using cmd and powershell, but not working with cmder. using the just released version 0.2.19.

@lufia
Copy link
Contributor

lufia commented Jan 23, 2021

What cmder is? Could I get the workflow file to reproduce the error?

@catthehacker
Copy link
Member

What cmder is? Could I get the workflow file to reproduce the error?

https://cmder.net/

Cmder is a software package created out of pure frustration over the absence of nice console emulators on Windows. It is based on amazing software, and spiced up with the Monokai color scheme and a custom prompt layout, looking sexy from the start.

@yuuuxt
Copy link

yuuuxt commented Jan 24, 2021

What cmder is? Could I get the workflow file to reproduce the error?

Hi @lufia ,

First of all thanks for your work! You can reproduce with the following steps:

  • download a portable version of cmder (link), put it somewhere and open it;
  • clone the demo (sample repo) provided;
  • run act.

I just tried and reproduced.

@catthehacker
Copy link
Member

Works fine for me
image

@yuuuxt
Copy link

yuuuxt commented Jan 24, 2021

Then I have no idea what went wrong..

Anyway I can use act with something other than cmder :)

@mjuarez
Copy link

mjuarez commented Jan 27, 2021

I came across this issue after having act interrupted mid-way through a job and leaving the act's cache in a bad state. I ran rm -rf ~/.cache/act and was able to continue working

@github-actions
Copy link
Contributor

Issue is stale and will be closed in 14 days unless there is new activity

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

No branches or pull requests