hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.58k stars 9.54k forks source link

Error: error satisfying plugin requirements #16746

Closed agyepiga closed 6 years ago

agyepiga commented 6 years ago

Terraform Version

Terraform 10.8 provider.aws 0.1.4 provider.random 0.1.0 provider.template 0.1.1

error_satisfying_plugin_reqs.txt

jbardin commented 6 years ago

The relevant portion of the linked text file:

>terraform plan
panic: Malformed constraint: >= 0.1.

goroutine 2002 [running]:
github.com/hashicorp/terraform/plugin/discovery.ConstraintStr.MustParse(0x145cd1d1, 0x7, 0x14693cc0, 0x145c6c40, 0x0)
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/plugin/discovery/version_set.go:28 +0x62
github.com/hashicorp/terraform/terraform.moduleTreeConfigDependencies(0x14632a40, 0x0, 0x0)
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/terraform/module_dependencies.go:62 +0x1df
github.com/hashicorp/terraform/terraform.ModuleTreeDependencies(0x14632a40, 0x143fa6c0, 0x145d3660)
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/terraform/module_dependencies.go:23 +0x29
github.com/hashicorp/terraform/terraform.NewContext(0x143ee600, 0x0, 0x0, 0x31bf200)
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/terraform/context.go:187 +0x193
github.com/hashicorp/terraform/backend/local.(*Local).context(0x145faa80, 0x145fab40, 0x2, 0x2, 0x3, 0x14606aa0, 0x2)
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/backend/local/backend_local.go:63 +0x64a
github.com/hashicorp/terraform/backend/local.(*Local).opPlan(0x145faa80, 0x31bc340, 0x142140e4, 0x145fab40, 0x14606a60)
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/backend/local/backend_plan.go:58 +0x1af
github.com/hashicorp/terraform/backend/local.(*Local).(github.com/hashicorp/terraform/backend/local.opPlan)-fm(0x31bc340, 0x142140e4, 0x145fab40, 0x14606a60)
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/backend/local/backend.go:251 +0x40
github.com/hashicorp/terraform/backend/local.(*Local).Operation.func1(0x145faa80, 0x14623eb8, 0x14623eb0, 0x31bc340, 0x142140e4, 0x145fab40, 0x14606a60)
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/backend/local/backend.go:273 +0x7f
created by github.com/hashicorp/terraform/backend/local.(*Local).Operation
        /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/hashicorp/terraform/backend/local/backend.go:270 +0x129
jbardin commented 6 years ago

Hi @agyepiga,

It looks like you have an invalid constraint string in your configuration. What you probably want is:

version = "~>0.1.0"

We should be catching that during validation however.

apparentlymart commented 6 years ago

There is another issue open for the fact that we are not catching version constraint syntax errors during validation. (I wasn't able to find it quickly to link it here.)

agyepiga commented 6 years ago

I am now getting an error that shows $ terraform init -backend=true Initializing the backend... Successfully configured the backend "s3"! Terraform will automatically use this backend unless the backend configuration changes. **Error getting plugins: module root: 1 error(s) occurred:

I have tried everything and not sure where this error is coming from. Any suggestions?

My set up is creating the following resources: aws_network_acl aws_alb (target group, listener) aws_launch_configuration aws_autoscaling_group aws_customer_gateway aws_cloudwatch_log_group aws_cloudwatch_metric_alarm data template aws_vpc_dhcp_options aws_ecs_service aws_ecs_task_definition aws_egress_only_internet_gateway aws_eip aws_iam_policy aws_internet_gateway aws_kms_key aws_nat_gateway aws_vpc_peering_connection aws_rds_cluster_instance aws_route (route table and association) aws_security_group aws_sns_topic aws_sqs_queue aws_subnet aws_vpc aws_vpn_connection aws_vpn_gateway_attachment aws_vpn_gateway_route_propagation

jbardin commented 6 years ago

@agyepiga,

That error is because of an invalid configuration block starting with tags. You probably have some misplaces braces, and running terraform fmt on the file will help it stand out better.

agyepiga commented 6 years ago

@jbardin thank you for the help at addressing the issue by correcting the version to read version = "~>0.1.0" Thank you for the resolution on correcting the misplaced braces and the suggesting to run terraform fmt. The resolution on the misplaced braces is solved by your additional details in 16802

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.