tenable/terrascan

Failed to fetch latest version for builtin terraform provider

scootafew opened this issue · 1 comments

  • terrascan version: v1.18.3
  • Operating System: Ubuntu 22

Description

I am using the terraform_data resource which is available through the built-in provider with source address terraform.io/builtin/terraform.

When terrascan runs I get this error:

2024/01/02 16:21:20 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions
2024/01/02 16:21:20 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:46092->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:21:20 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 1s (10 left)
2024/01/02 16:21:21 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:46108->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:21:21 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 2s (9 left)
2024/01/02 16:21:23 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:42056->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:21:23 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 4s (8 left)
2024/01/02 16:21:27 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:42058->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:21:27 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 8s (7 left)
2024/01/02 16:21:35 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:52536->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:21:35 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 16s (6 left)
2024/01/02 16:21:51 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:49078->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:21:51 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 30s (5 left)
2024/01/02 16:22:21 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:51844->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:22:21 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 30s (4 left)
2024/01/02 16:22:51 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:34324->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:22:51 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 30s (3 left)
2024/01/02 16:23:22 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:57030->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:23:22 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 30s (2 left)
2024/01/02 16:23:52 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:48386->76.76.21.21:443: read: connection reset by peer
2024/01/02 16:23:52 [DEBUG] GET https://terraform.io/v1/providers/builtin/terraform/versions: retrying in 30s (1 left)
2024/01/02 16:24:22 [ERR] GET https://terraform.io/v1/providers/builtin/terraform/versions request failed: Get "https://terraform.io/v1/providers/builtin/terraform/versions": read tcp 172.17.0.2:50086->76.76.21.21:443: read: connection reset by peer
2024-01-02T16:24:22.160Z	error	http/request.go:56	failed to make http request; method: 'GET', url: 'https://terraform.io/v1/providers/builtin/terraform/versions'
2024-01-02T16:24:22.161Z	warn	commons/terraform-provider.go:99	failed to fetch latest version for terraform provider, error: failed to make http request

The connection reset by peer is expected due to my network setup but I don't think this call should be happening anyway - the URL does not exist as builtin/terraform is not a "real" provider. Therefore I would expect that terrascan does not try and list versions for it

What I Did

Terrascan ran as part of superlinter v5.7.2

The error is not fatal and the scan completes successfully but the retries with backoff are slowing down my builds.

Currently having the same issue, but in another scenario.

We have a local provider checked out within the git repository, thus not available in a public/private registry but on a filesystem. Even when configuring the .terraformrc file to address that the provider can be found on a filesystem (using filesystem_mirror in this case), Terrascan still tries to download it through a GET operation over https. Result is multiple retries to download the provider and eventually failing because of too many failed attempts.

Documentation about the .terraformrc file and the available provider installation methods can be found here: https://developer.hashicorp.com/terraform/cli/config/config-file