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.

Flakey error when running `go version`

See original GitHub issue

Description: When running the action, we occasionally see an error:

  with:
    go-version: ~1.18
    stable: true
    token: ***
  env:
    GOOS: linux
    GOARCH: amd64
    GO111MODULE: on
    CGO_ENABLED: 0
    DB_HOST: localhost
    DB_PORT: 5432
    DB_USER: postgres
    DB_PASSWORD: unit-tests
    DB_NAME: ci_db_test
    DB_SSLMODE: disable
    GHE_TOKEN: ***
Setup go stable version spec ~1.18
Attempting to download ~1.18...
matching ~1.18...
Acquiring 1.18.1 from https://github.com/actions/go-versions/releases/download/1.18.1-2171178401/go-1.18.1-linux-x64.tar.gz
Extracting Go...
/usr/bin/tar xz --warning=no-unknown-keyword -C /runner/_work/_temp/b1954076-7176-4386-bf4f-6a1bb12367dc -f /runner/_work/_temp/a66da6cf-48f5-407c-a309-7eb94d6199ce
Successfully extracted go to /runner/_work/_temp/b1954076-7176-4386-bf4f-6a1bb12367dc
Adding to the cache ...
Successfully cached go to /runner/shared/_tools/go/1.18.1/x64
Added go to the path
Successfully setup go version ~1.18
/bin/sh: 1: version: not found
Error: Command failed:  version
/bin/sh: 1: version: not found

This appears to be coming from here https://github.com/actions/setup-go/blob/fcdc43634adb5f7ae75a9d7a9b9361790f7293e2/src/main.ts#L47

Action version: v3

Platform:

  • [ x] Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • [ x] Self-hosted

Tools version:

1.18

Repro steps:
Run the action. It’s not consistently reproducable, only fails about 1-2% of the time

Expected behavior: go version should be run without error

Actual behavior: version command is attempted to be run since the go variable isn’t set and thus the command isn’t found

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
panticmiloscommented, Jul 12, 2022

@mat285, for me, the first step would be figuring out if this issue is related to a self-hosted runner or if it can be reproduced on hosted agents as well. I will get back to you with more info

1reaction
dmitry-shibanovcommented, Jul 8, 2022

Hello @mat285. Thank you for your report. We’ll investigate the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Better flaky test support · Issue #27181 · golang/go · GitHub
flaky ()" in test methods to indicate the tests are flaky. Obviously, this can be done using other mechanisms as well but this...
Read more >
Reproducing a Flaky Test in Go - InfluxData
We would infrequently see this test fail with a mysterious failure message, and running it again would always pass.
Read more >
How to Fix Flaky Tests - Semaphore CI
Randomly failing tests are the hardest to debug. Here's a framework you can use to fix them and keep your test suite healthy....
Read more >
7 steps for fixing flaky tests - Vesko Iliev
In this post I'll share how I go about fixing such problems. ... Run the flaky test Until Failure and see what happens....
Read more >
golang-github-bmatsuo-lmdb-go: flaky autopkgtest on s390x
Source: golang-github-bmatsuo-lmdb-go. Version: 1.8.0+git20170215.a14b5a3-3. Severity: serious. User: debi...@lists.debian.org
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