terraform-linters / tflint

A Pluggable Terraform Linter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux install failing

ddelange opened this issue · comments

Summary

install_linux.sh fails in Bitbucket Pipelines with an alpine image:

$ apk add curl coreutils bash unzip musl-dev gcc python3-dev py3-pip
$ curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
arch=amd64
os=linux_amd64
====================================================
Looking up the latest version ...
curl: (22) The requested URL returned error: 403
Downloading TFLint 
curl: (22) The requested URL returned error: 404
Downloaded successfully
====================================================
Unpacking /tmp/tflint.GgqLkXBDN1/tflint.zip ...
unzip:  cannot find or open /tmp/tflint.GgqLkXBDN1/tflint.zip, /tmp/tflint.GgqLkXBDN1/tflint.zip.zip or /tmp/tflint.GgqLkXBDN1/tflint.zip.ZIP.
Installing /tmp/tflint.GgqLkXBDN1/tflint to /usr/local/bin/ ...
install: cannot stat '/tmp/tflint.GgqLkXBDN1/tflint': No such file or directory
Failed to install tflint
$ TFLINT_VERSION=v0.48.0 curl -s https://raw.githubusercontent.com/terraform-linters/tflint/v0.48.0/install_linux.sh | bash
arch=amd64
os=linux_amd64
====================================================
Looking up the latest version ...
curl: (22) The requested URL returned error: 403
Downloading TFLint 
curl: (22) The requested URL returned error: 404
Downloaded successfully
====================================================
Unpacking /tmp/tflint.kT03zGhfah/tflint.zip ...
unzip:  cannot find or open /tmp/tflint.kT03zGhfah/tflint.zip, /tmp/tflint.kT03zGhfah/tflint.zip.zip or /tmp/tflint.kT03zGhfah/tflint.zip.ZIP.
Installing /tmp/tflint.kT03zGhfah/tflint to /usr/local/bin/ ...
install: cannot stat '/tmp/tflint.kT03zGhfah/tflint': No such file or directory
Failed to install tflint

In the install script, I see curl --fail flag:

 -f, --fail          Fail silently (no output at all) on HTTP errors
     --fail-early    Fail on first transfer error, do not continue

So I think there are two things going on here:

  • The script continues with Downloading TFLint and Downloaded successfully (despite 403 and 404 respectively).
  • In the second command, I pass TFLINT_VERSION explicitly, yet still I see Looking up the latest version ... -- an api request that apparently gets blocked with 403 for unauthenticated requests coming from Bitbucket Pipelines

Command

tflint

Terraform Configuration

--

TFLint Configuration

--

Output

--

TFLint Version

0.48.0 / master

Terraform Version

--

Operating System

  • Linux
  • macOS
  • Windows