The terraform build job is broken

gitlab-ci.yml file:

include:
  - template: Terraform.latest.gitlab-ci.yml

variables:
  TF_STATE_NAME: default
  TF_CACHE_KEY: default
  TF_ROOT: iac
  TF_LOG: DEBUG

build job log:

Skip to content
GitLab
Next
Search GitLab
/
3
99+
Help
Liora Milbaum
G
Gitlab Runner
Project information
Repository
Issues
0
Merge requests
2
CI/CD
Pipelines
Editor
Jobs
Schedules
Test Cases
Security & Compliance
Deployments
Packages and registries
Infrastructure
Monitor
Analytics
Wiki
Snippets
Settings
Collapse sidebar
CentOSCentOS

coffre
Gitlab Runner
Jobs
#3289249636
 failed Job build triggered just now by 

Liora Milbaum
Search job log
Running with gitlab-runner 15.6.0~beta.186.ga889181a (a889181a)
  on blue-2.shared.runners-manager.gitlab.com/default XxUrkriX
Resolving secrets
00:00
Preparing the "docker+machine" executor
Using Docker executor with image registry.gitlab.com/gitlab-org/terraform-images/stable:latest ...
Authenticating with credentials from job payload (GitLab Registry)
Pulling docker image registry.gitlab.com/gitlab-org/terraform-images/stable:latest ...
Using docker image sha256:ec26a06e7afcb745426faadf37240cc16bc28b09d5f01bcc3077ae79c0bc2682 for registry.gitlab.com/gitlab-org/terraform-images/stable:latest with digest registry.gitlab.com/gitlab-org/terraform-images/stable@sha256:3338f1755cd6067aa31f94d60e8334219fcf2a17b329c25e28d38429f03b8e5b ...
Preparing environment
00:01
Running on runner-xxurkrix-project-38133848-concurrent-0 via runner-xxurkrix-shared-1667899449-73b75510...
Getting source from Git repository
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/CentOS/automotive/coffre/gitlab_runner/.git/
Created fresh repository.
Checking out 7dbb28e2 as refs/merge-requests/57/head...
Skipping Git submodules setup
Restoring cache
Checking cache for iac-non_protected...
Downloading cache.zip from https://storage.googleapis.com/gitlab-com-runners-cache/project/38133848/iac-non_protected 
Successfully extracted cache
Executing "step_script" stage of the job script
Using docker image sha256:ec26a06e7afcb745426faadf37240cc16bc28b09d5f01bcc3077ae79c0bc2682 for registry.gitlab.com/gitlab-org/terraform-images/stable:latest with digest registry.gitlab.com/gitlab-org/terraform-images/stable@sha256:3338f1755cd6067aa31f94d60e8334219fcf2a17b329c25e28d38429f03b8e5b ...
$ cd "${TF_ROOT}"
$ gitlab-terraform plan
2022-11-08T09:25:54.146Z [INFO]  Terraform version: 1.1.9
2022-11-08T09:25:54.147Z [INFO]  Go runtime version: go1.17.2
2022-11-08T09:25:54.147Z [INFO]  CLI args: []string{"terraform", "-version"}
2022-11-08T09:25:54.147Z [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2022-11-08T09:25:54.147Z [DEBUG] Not reading CLI config directory because config location is overridden by environment variable
2022-11-08T09:25:54.154Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-11-08T09:25:54.155Z [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2022-11-08T09:25:54.155Z [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2022-11-08T09:25:54.155Z [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2022-11-08T09:25:54.155Z [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2022-11-08T09:25:54.159Z [INFO]  CLI command args: []string{"version", "-version"}
2022-11-08T09:25:54.584Z [INFO]  Terraform version: 1.1.9
2022-11-08T09:25:54.584Z [INFO]  Go runtime version: go1.17.2
2022-11-08T09:25:54.585Z [INFO]  CLI args: []string{"terraform", "-chdir=/builds/CentOS/automotive/coffre/gitlab_runner/iac", "init", "-input=false", "-reconfigure"}
2022-11-08T09:25:54.585Z [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2022-11-08T09:25:54.585Z [INFO]  Loading CLI configuration from /root/.terraformrc
2022-11-08T09:25:54.585Z [DEBUG] Not reading CLI config directory because config location is overridden by environment variable
2022-11-08T09:25:54.585Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-11-08T09:25:54.586Z [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2022-11-08T09:25:54.586Z [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2022-11-08T09:25:54.586Z [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2022-11-08T09:25:54.586Z [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2022-11-08T09:25:54.586Z [INFO]  CLI command args: []string{"init", "-input=false", "-reconfigure"}
Initializing modules...
2022-11-08T09:25:54.610Z [DEBUG] Module installer: begin gitlab-runner
2022-11-08T09:25:54.644Z [DEBUG] Module installer: begin gitlab-runner.cache
2022-11-08T09:25:54.648Z [DEBUG] Module installer: begin gitlab-runner.terminate_instances_lifecycle_function
Initializing the backend...
2022-11-08T09:25:54.688Z [DEBUG] checking for provisioner in "."
2022-11-08T09:25:54.688Z [DEBUG] checking for provisioner in "/usr/local/bin"
Initializing provider plugins...
- Finding latest version of hashicorp/random...
2022-11-08T09:25:54.689Z [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2022-11-08T09:25:54.790Z [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/random/versions
- Finding latest version of hashicorp/archive...
2022-11-08T09:25:54.838Z [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/archive/versions
- Finding hashicorp/aws versions matching ">= 4.0.0, ~> 4.0, 4.38.0"...
2022-11-08T09:25:54.888Z [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/aws/versions
2022-11-08T09:25:54.941Z [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/archive/2.2.0/download/linux/amd64
2022-11-08T09:25:54.988Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-archive/2.2.0/terraform-provider-archive_2.2.0_SHA256SUMS
2022-11-08T09:25:55.080Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-archive/2.2.0/terraform-provider-archive_2.2.0_SHA256SUMS.72D7468F.sig
- Installing hashicorp/archive v2.2.0...
2022-11-08T09:25:55.328Z [DEBUG] Provider signed by 34365D9472D7468F HashiCorp Security (hashicorp.com/security) <security@hashicorp.com>
- Installed hashicorp/archive v2.2.0 (signed by HashiCorp)
2022-11-08T09:25:55.520Z [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/aws/4.38.0/download/linux/amd64
2022-11-08T09:25:55.567Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-aws/4.38.0/terraform-provider-aws_4.38.0_SHA256SUMS
2022-11-08T09:25:55.631Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-aws/4.38.0/terraform-provider-aws_4.38.0_SHA256SUMS.72D7468F.sig
- Installing hashicorp/aws v4.38.0...
2022-11-08T09:25:56.499Z [DEBUG] Provider signed by 34365D9472D7468F HashiCorp Security (hashicorp.com/security) <security@hashicorp.com>
- Installed hashicorp/aws v4.38.0 (signed by HashiCorp)
2022-11-08T09:26:01.794Z [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/random/3.4.3/download/linux/amd64
2022-11-08T09:26:01.842Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-random/3.4.3/terraform-provider-random_3.4.3_SHA256SUMS
2022-11-08T09:26:01.907Z [DEBUG] GET https://releases.hashicorp.com/terraform-provider-random/3.4.3/terraform-provider-random_3.4.3_SHA256SUMS.72D7468F.sig
- Installing hashicorp/random v3.4.3...
2022-11-08T09:26:02.151Z [DEBUG] Provider signed by 34365D9472D7468F HashiCorp Security (hashicorp.com/security) <security@hashicorp.com>
- Installed hashicorp/random v3.4.3 (signed by HashiCorp)
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized!
2022-11-08T09:26:02.365Z [INFO]  Terraform version: 1.1.9
2022-11-08T09:26:02.365Z [INFO]  Go runtime version: go1.17.2
2022-11-08T09:26:02.365Z [INFO]  CLI args: []string{"terraform", "-chdir=/builds/CentOS/automotive/coffre/gitlab_runner/iac", "plan", "-input=false", "-out=plan.cache"}
2022-11-08T09:26:02.366Z [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2022-11-08T09:26:02.366Z [INFO]  Loading CLI configuration from /root/.terraformrc
2022-11-08T09:26:02.366Z [DEBUG] Not reading CLI config directory because config location is overridden by environment variable
2022-11-08T09:26:02.366Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-11-08T09:26:02.367Z [DEBUG] ignoring non-existing provider search directory /root/.terraform.d/plugins
2022-11-08T09:26:02.367Z [DEBUG] ignoring non-existing provider search directory /root/.local/share/terraform/plugins
2022-11-08T09:26:02.367Z [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2022-11-08T09:26:02.367Z [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2022-11-08T09:26:02.368Z [INFO]  CLI command args: []string{"plan", "-input=false", "-out=plan.cache"}
╷
│ Error: Backend initialization required, please run "terraform init"
│ 
│ Reason: Unsetting the previously set backend "http"
│ 
│ The "backend" is the interface that Terraform uses to store state,
│ perform operations, etc. If this message is showing up, it means that the
│ Terraform configuration you're using is using a custom configuration for
│ the Terraform backend.
│ 
│ Changes to backend configurations require reinitialization. This allows
│ Terraform to set up the new configuration, copy existing state, etc. Please
│ run
│ "terraform init" with either the "-reconfigure" or "-migrate-state" flags
│ to
│ use the current configuration.
│ 
│ If the change reason above is incorrect, please verify your configuration
│ hasn't changed and try again. At this point, no changes to your existing
│ configuration or state have been made.
╵
Uploading artifacts for failed job
00:01
Uploading artifacts...
WARNING: iac/plan.json: no matching files. Ensure that the artifact path is relative to the working directory 
ERROR: No files to upload                          
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
build
 
Duration: 1 minute 19 seconds
Finished: 22 minutes ago
Queued: 0 seconds
Timeout: 1h (from project)

Runner: #12270831 (XxUrkriX) 2-blue.shared.runners-manager.gitlab.com/default
Commit 7dbb28e2  in !57
Debugging terraform

 Pipeline #688433193 for !57 with debug
build