Skip to content

Commit

Permalink
update troubleshooting file
Browse files Browse the repository at this point in the history
  • Loading branch information
caetano-colin committed May 24, 2024
1 parent 80f5791 commit 533361f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,37 +90,37 @@ This could be due to init.defaultBranch being set to something other than
When running the build for the branch `production` in step 3-networks in your **Foundation CI/CD Pipeline** the build fails with:

```
state snapshot was created by Terraform v1.x.x, which is newer than current v1.3.0; upgrade to Terraform v1.x.x or greater to work with this state
state snapshot was created by Terraform v1.x.x, which is newer than current v1.3.10; upgrade to Terraform v1.x.x or greater to work with this state
```

**Cause:**

The manual deploy step for the shared environment in [3-networks](../3-networks#deploying-with-cloud-build) was executed with a Terraform version newer than version v1.3.0 used in the **Foundation CI/CD Pipeline**.
The manual deploy step for the shared environment in [3-networks](../3-networks#deploying-with-cloud-build) was executed with a Terraform version newer than version v1.3.10 used in the **Foundation CI/CD Pipeline**.

**Solution:**

You have two options:

#### Downgrade your local Terraform version

You will need to re-run the deploy of the 3-networks shared environment with Terraform v1.3.0.
You will need to re-run the deploy of the 3-networks shared environment with Terraform v1.3.10.

Steps:

- Go to folder `gcp-networks/envs/shared/`.
- Update `backend.tf` with your bucket name from the 0-bootstrap step.
- Run `terraform destroy` in the folder using the Terraform v1.x.x version.
- Delete the Terraform state file in `gs://YOUR-TF-STATE-BUCKET/terraform/networks/envs/shared/default.tfstate`. This bucket is in your **Seed Project**.
- Install Terraform v1.3.0.
- Re-run the manual deploy of 3-networks shared environment using Terraform v1.3.0.
- Install Terraform v1.3.10.
- Re-run the manual deploy of 3-networks shared environment using Terraform v1.3.10.

#### Upgrade your 0-bootstrap runner image Terraform version

Replace `1.x.x` with the actual version of your local Terraform version in the following instructions:

- Go to folder `0-bootstrap`.
- Edit the local `terraform_version` in the Terraform [cb.tf](../0-bootstrap/cb.tf) file:
- Upgrade local `terraform_version` from `"1.3.0"` to `"1.x.x"`
- Upgrade local `terraform_version` from `"1.3.10"` to `"1.x.x"`
- Run `terraform init`.
- Run `terraform plan` and review the output.
- Run `terraform apply`.
Expand Down

0 comments on commit 533361f

Please sign in to comment.