question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action cannot be used with Self hosted runner

See original GitHub issue

Intro

Type of issue: Bug report

Reproduce

  1. On a clean linux machine (I tested on Ubuntu20.04, Ubuntu18.04 and Debian10).
  2. Following the instruction in https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service, to create a self-hosted runner
  3. Registrate it to your GitHub Account’s runner
  4. Create a sample repo which has access to that self-hosted runner
  5. Create a GitHub config file
jobs:
  gotest:
    name: GoTest
    runs-on: [self-hosted, linux]
    steps:
      - uses: AutoModality/action-clean@v1
      - name: Checkout
      - uses: actions/setup-go@v2
        with:
          go-version: '1.14.*'
      - name: Go Env
        run: |
          go env
  1. Get this error in actions/setup-go@v2, but it won’t exit the pipeline.
(node:12435) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: a path argument must be provided
    at Object.<anonymous> (/github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:4752:18)
    at Generator.next (<anonymous>)
    at /github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:4692:71
    at new Promise (<anonymous>)
    at module.exports.672.__awaiter (/github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:4688:12)
    at Object.mkdirP (/github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:4751:12)
    at Object.<anonymous> (/github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:204:22)
    at Generator.next (<anonymous>)
    at /github-action-runner/_work/_actions/actions/setup-go/v2/dist/index.js:57:71
    at new Promise (<anonymous>)
  1. This is a non stopping error, so in go env line, another error will occur.
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined
  1. Check the go env and you can find that GOPATH, GOENV are missing.

Possible bugs

  1. As the $HOME is not correctly exported and GOCACHE is "off", go cannot run.
  2. Besides, another possible problem may be in this part and thus get a a path argument must be provided error. https://github.com/actions/setup-go/blob/3b4dc6cbed1779f759b9c638cb83696acea809d1/src/main.ts#L67-L73

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
divyansh-guptacommented, Dec 14, 2021

Understood and agreed - however I meant creating a folder elsewhere, even in tmp, and setting GOPATH and GOCACHE there? At a minimum, this limitation and the workaround with setting the GO values yourself should be documented in the README. What do you think?

1reaction
vsafonkincommented, Dec 14, 2021

I believe the reason of issue is missing $HOME variable on the self-hosted runners. Issue is closed because we cannot resolve it from setup-go action side. Please, contact us if you have any questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Github Actions self hosted runner - YouTube
docs: https://docs.github.com/en/ actions /hosting-your-own- runners /about- self - hosted -runnersFollow me ... Your browser can't play this video.
Read more >
GitHub Actions: secure self-hosted runners by limiting them to ...
You can now enforce consistent usage of self-hosted runner groups across your organization and enterprise.
Read more >
GitHub self-hosted runners - Apache Software Foundation
This uses the self-hosted runners for pushes, scheduled builds, and PRs from a repo owner or contributor, but not normal public runners for...
Read more >
Can GitHub Actions self hosted runners be used without a ...
There is nothing in that article that implies anything about self-hosted runners being sandboxed from an internal network perspective.
Read more >
Create your Self-Hosted Github Action Runner in 5 minutes
When using Github's default runner, you will get a new VM for each workflow execution, however if you use your own self-hosted runner,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found