Skip to content

Instantly share code, notes, and snippets.

@grimlokason
Last active December 23, 2022 15:53
Show Gist options
  • Save grimlokason/7010c546e9084270d6c47b614dd11663 to your computer and use it in GitHub Desktop.
Save grimlokason/7010c546e9084270d6c47b614dd11663 to your computer and use it in GitHub Desktop.
bash-5.1# export TF_DEBUG=trace
bash-5.1# rm -Rf .terraform*
bash-5.1# terraform init -upgrade -reconfigure -input=false -backend-config="access_key=***" -backend-config="secret_key=***"
Upgrading modules...
Downloading file:///root/.terraform.d/modules/FlexibleEngineCloud/terraform-flexibleengine-secgroup/v2.0.1 for env_secgroup...
- env_secgroup in .terraform/modules/env_secgroup
Initializing the backend...
Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing provider plugins...
- Finding hashicorp/local versions matching "~> 1.0"...
- Finding local.terraform.com/root/flexibleengine versions matching "1.35.1"...
- Installing hashicorp/local v1.4.0...
- Installed hashicorp/local v1.4.0 (signed by HashiCorp)
- Installing local.terraform.com/root/flexibleengine v1.35.1...
- Installed local.terraform.com/root/flexibleengine v1.35.1 (unauthenticated)
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.
│ Warning: Incomplete lock file information for providers
│ Due to your customized provider installation methods, Terraform was forced to calculate
│ lock file checksums locally for the following providers:
│ - local.terraform.com/root/flexibleengine
│ The current .terraform.lock.hcl file only includes checksums for linux_amd64, so
│ Terraform running on another platform will fail to install these providers.
│ To calculate additional checksums for another platform, run:
│ terraform providers lock -platform=linux_amd64
│ (where linux_amd64 is the platform to generate)
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
bash-5.1# terraform validate
│ Error: failed to read schema for module.env_secgroup.flexibleengine_networking_secgroup_rule_v2.egress_with_source_security_group_id in local.terraform.com/root/flexibleengine: failed to instantiate provider "local.terraform.com/root/flexibleengine" to obtain schema: fork/exec .terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_1.35.1_linux_amd64.zip: exec format error
bash-5.1# file .terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_1.35.1_linux_amd64.zip
.terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_1.35.1_linux_amd64.zip: Zip archive data, at least v2.0 to extract
bash-5.1# rm .terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_1.35.1_linux_amd64.zip
bash-5.1# ln -s $PWD/.terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_v1.35.1 $PWD/.terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_1.35.1_linux_amd64.zip
bash-5.1# terraform validate
│ Error: local.terraform.com/root/flexibleengine: the cached package for local.terraform.com/root/flexibleengine 1.35.1 (in .terraform/providers) does not match any of the checksums recorded in the dependency lock file
################## "Solving" issue
bash-5.1# rm .terraform.lock.hcl
bash-5.1# terraform init -upgrade -reconfigure -input=false -backend-config="access_key=***" -backend-config="secret_key=***"
Upgrading modules...
Downloading file:///root/.terraform.d/modules/FlexibleEngineCloud/terraform-flexibleengine-secgroup/v2.0.1 for env_secgroup...
- env_secgroup in .terraform/modules/env_secgroup
Initializing the backend...
Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing provider plugins...
- Finding hashicorp/local versions matching "~> 1.0"...
- Finding local.terraform.com/root/flexibleengine versions matching "1.35.1"...
- Installing hashicorp/local v1.4.0...
- Installed hashicorp/local v1.4.0 (signed by HashiCorp)
- Installing local.terraform.com/root/flexibleengine v1.35.1...
- Installed local.terraform.com/root/flexibleengine v1.35.1 (unauthenticated)
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.
│ Warning: Incomplete lock file information for providers
│ Due to your customized provider installation methods, Terraform was forced to calculate
│ lock file checksums locally for the following providers:
│ - local.terraform.com/root/flexibleengine
│ The current .terraform.lock.hcl file only includes checksums for linux_amd64, so
│ Terraform running on another platform will fail to install these providers.
│ To calculate additional checksums for another platform, run:
│ terraform providers lock -platform=linux_amd64
│ (where linux_amd64 is the platform to generate)
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
bash-5.1# terraform validate
Success! The configuration is valid.
bash-5.1# file .terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_1.35.1_linux_amd64.zip
.terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_1.35.1_linux_amd64.zip: symbolic link to /workdir/.terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_v1.35.1
bash-5.1# file /workdir/.terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_v1.35.1
/workdir/.terraform/providers/local.terraform.com/root/flexibleengine/1.35.1/linux_amd64/terraform-provider-flexibleengine_v1.35.1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=L6hwO2W4YIJabla6qpfC/3uYRH_5thfkhaW-waS4-/v9vo2vFgRM9kMRO-HiwR/NxgG4XQqkH-FZN8TFbEN, stripped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment