getsentry / tacos-gha

Terraform Automation & Collaboration Software (TACOS) help organizations to scale the use of Terraform by enabling collaboration through governance, access controls, and automation of Terraform runs.
Apache License 2.0
1 stars 0 forks source link

Cryptic error but successful plan #221

Open mdtro opened 3 months ago

mdtro commented 3 months ago
$ sudo-gcp terragrunt run-all plan -out $slice/tfplan
You are authenticated for the next hour as: [redacted]@[redacted].iam.gserviceaccount.com
time=2024-06-05T22:28:59Z level=error msg=terraform invocation failed in . prefix=[$slice] 
time=2024-06-05T22:28:59Z level=error msg=Module . has finished with an error: 1 error occurred:
    * [.] exit status 2

 prefix=[.] 
time=2024-06-05T22:28:59Z level=error msg=1 error occurred:
    * [.] exit status 2

I received this error on this particular GHA run https://github.com/getsentry/ops/actions/runs/9392078538/attempts/1#summary-25865602233

The worfklow run was successful and the plan looks good regardless of the error?

mwarkentin commented 3 months ago

Another: https://github.com/getsentry/ops/actions/runs/9519600055/job/26243173840

$ sudo-gcp terragrunt run-all plan -out $slice/tfplan
You are authenticated for the next hour as: team-sre-tf-state-admin@sac-prod-sa.iam.gserviceaccount.com
time=2024-06-14T16:53:17Z level=error msg=Module . has finished with an error: 1 error occurred:
    * [.terragrunt-cache/j9FJkt58gcMdfb7fughyqM5eLG8/0rghWROp0gJdHK4BUmBouoAzp4g/cluster_zookeeper] exit status 1

 prefix=[.] 
time=2024-06-14T16:53:17Z level=error msg=1 error occurred:
    * [.terragrunt-cache/j9FJkt58gcMdfb7fughyqM5eLG8/0rghWROp0gJdHK4BUmBouoAzp4g/cluster_zookeeper] exit status 1

module.instances[1].data.google_iam_policy.os_login: Reading...
module.instances[2].data.google_iam_policy.os_login: Reading...
module.instances[0].data.google_iam_policy.os_login: Reading...
module.instances[1].data.google_iam_policy.os_login: Read complete after 0s [id=1708961782]
module.instances[2].data.google_iam_policy.os_login: Read complete after 0s [id=1708961782]
module.instances[0].data.google_iam_policy.os_login: Read complete after 0s [id=1708961782]

Planning failed. Terraform encountered an error while generating this plan.

Locally:

Terraform planned the following actions, but then encountered a problem:

  # google_compute_disk.data[1] will be updated in-place
  ~ resource "google_compute_disk" "data" {
        id                        = "projects/mattrobenolt-kube/zones/us-west1-b/disks/zookeeper-test-2-data"
      ~ labels                    = {
          - "autogrow"           = "true" -> null
          - "autogrow_max"       = "50" -> null
            # (14 unchanged elements hidden)
        }
        name                      = "zookeeper-test-2-data"
        # (13 unchanged attributes hidden)
    }

  # google_compute_disk.data[2] will be updated in-place
  ~ resource "google_compute_disk" "data" {
        id                        = "projects/mattrobenolt-kube/zones/us-west1-c/disks/zookeeper-test-3-data"
      ~ labels                    = {
          - "autogrow"           = "true" -> null
            # (14 unchanged elements hidden)
        }
        name                      = "zookeeper-test-3-data"
        # (13 unchanged attributes hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.
╷
│ Error: Instance cannot be destroyed
│
│   on main.tf line 22:
│   22: resource "google_compute_disk" "data" {
│
│ Resource google_compute_disk.data[0] has lifecycle.prevent_destroy set, but
│ the plan calls for this resource to be destroyed. To avoid this error and
│ continue with the plan, either disable lifecycle.prevent_destroy or reduce
│ the scope of the plan using the -target flag.
╵
ERRO[0007] Terraform invocation failed in /Users/mwarkentin/repos/sentry/ops/terragrunt/regions/single-tenant/zookeeper-test/s4s/.terragrunt-cache/M9GLvX1vQWtmFC7_TdBfDULdyWk/0rghWROp0gJdHK4BUmBouoAzp4g/cluster_zookeeper  prefix=[/Users/mwarkentin/repos/sentry/ops/terragrunt/regions/single-tenant/zookeeper-test/s4s]
ERRO[0007] 1 error occurred:
    * exit status 1