skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

"error checking for color support" seems to fail build

Open iamnoah opened this issue 2 years ago • 0 comments

Expected behavior

When run in Github Actions, skaffold build does not fail with a valid configuration, or fails with a clear error.

Actual behavior

In the GitHub Actions runner only skaffold build fails with no clear cause. Turning on debug logging shows an error from a tput colors exec.

Information

  • Skaffold version: 1.38.0
  • Operating system: ubuntu-latest
  • Installed via: skaffold.dev (see workflow)
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta28
kind: Config
metadata:
  name: demo
build:
  artifacts:
    - image: ghcr.io/iamnoah/skaffold-tput-colors-bug/baz
      ko:
        main: ./foo
      hooks:
        before:
          - command: [go, mod, vendor]
          - command: [sleep, "3"]
    - image: ghcr.io/iamnoah/skaffold-tput-colors-bug/foo
      docker:
        dockerfile: Dockerfile
      hooks:
        before:
          - command: [go, mod, vendor]
          - command: [sleep, "3"]
    - image: ghcr.io/iamnoah/skaffold-tput-colors-bug/bar
      docker:
        dockerfile: Dockerfile
      hooks:
        before:
          - command: [go, mod, vendor]
          - command: [sleep, "3"]

Steps to reproduce the behavior

Repo. I've struggled with this minimal test case. Sometimes it will fail and sometimes pass. Seemingly arbitrary changes in the private repo this originated from will get to a pass, but I have not found a consistent workaround.

All of these failures only occur in the Github Action runners. The same build commands succeed when I run them locally

See the run here. Only error I see (other than spurious gcloud output, which appears with success or failure) is:

time="2022-06-08T17:28:42Z" level=debug msg="Running command: [tput colors]" subtask=-1 task=DevLoop
[457](https://github.com/iamnoah/skaffold-tput-colors-bug/runs/6798763578?check_suite_focus=true#step:5:458)
time="2022-06-08T17:28:42Z" level=debug msg="error checking for color support: checking terminal colors: running [tput colors]\n - stdout: \"\"\n - stderr: \"tput: No value for $TERM and no -T specified\\n\"\n - cause: exit status 2" subtask=-1 task=DevLoop
[458](https://github.com/iamnoah/skaffold-tput-colors-bug/runs/6798763578?check_suite_focus=true#step:5:459)
{"builds":null}
[459](https://github.com/iamnoah/skaffold-tput-colors-bug/runs/6798763578?check_suite_focus=true#step:5:460)
exit status 1

The go mod vendor pre-hook seems to be crucial, so I suspect some kind of error there is being suppressed, but the only consistent error I see when the build fails is this tput error. Without -vdebug there was no error output.

iamnoah avatar Jun 08 '22 18:06 iamnoah