{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/17473","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/17473/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/17473/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/17473/events","html_url":"https://github.com/hashicorp/terraform/issues/17473","id":301273933,"number":17473,"title":"Init requests version for Terraform Provider","user":{"login":"ivan-m","id":792435,"avatar_url":"https://avatars1.githubusercontent.com/u/792435?v=4","gravatar_id":"","url":"https://api.github.com/users/ivan-m","html_url":"https://github.com/ivan-m","followers_url":"https://api.github.com/users/ivan-m/followers","following_url":"https://api.github.com/users/ivan-m/following{/other_user}","gists_url":"https://api.github.com/users/ivan-m/gists{/gist_id}","starred_url":"https://api.github.com/users/ivan-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivan-m/subscriptions","organizations_url":"https://api.github.com/users/ivan-m/orgs","repos_url":"https://api.github.com/users/ivan-m/repos","events_url":"https://api.github.com/users/ivan-m/events{/privacy}","received_events_url":"https://api.github.com/users/ivan-m/received_events","type":"User","site_admin":false},"labels":[{"id":85946957,"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":587361671,"url":"https://api.github.com/repos/hashicorp/terraform/labels/cli","name":"cli","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-01T04:27:51Z","updated_at":"2018-03-09T16:57:10Z","closed_at":"2018-03-09T16:57:10Z","author_association":"NONE","body":"```\r\nTerraform v0.11.3\r\n```\r\n\r\n### Terraform Configuration Files\r\n```hcl\r\nterraform {\r\n  required_version = \"~> 0.10\"\r\n}\r\n\r\ndata \"terraform_remote_state\" \"vpc\" {\r\n  backend = \"s3\"\r\n\r\n  config {\r\n    bucket = ...\r\n    key    = ...\r\n    region = ...\r\n  }\r\n}\r\n```\r\n\r\n### Debug Output\r\n\r\n_Does not seem relevant; can attach if required._\r\n\r\n### Crash Output\r\n\r\nN/A\r\n\r\n### Expected Behavior\r\n\r\nAFAICT there shouldn't be any suggestion to specify a version for the `\"terraform\"` provider.\r\n\r\n### Actual Behavior\r\n\r\n```\r\n$ terraform init\r\n[snip]\r\nThe following providers do not have any version constraints in configuration,\r\nso the latest version was installed.\r\n\r\nTo prevent automatic upgrades to new major versions that may contain breaking\r\nchanges, it is recommended to add version = \"...\" constraints to the\r\ncorresponding provider blocks in configuration, with the constraint strings\r\nsuggested below.\r\n\r\n* provider.terraform: version = \"~> 1.0\"\r\n[snip]\r\n```\r\n\r\nSo I add to my `.tf` file:\r\n```hcl\r\nprovider \"terraform\" {\r\n  version = \"~> 1.0\"\r\n}\r\n```\r\n\r\n`terraform init` is then happy, but:\r\n\r\n```\r\n$ terraform plan\r\nPlugin reinitialization required. Please run \"terraform init\".\r\nReason: Could not satisfy plugin requirements.\r\n\r\nPlugins are external binaries that Terraform uses to access and manipulate\r\nresources. The configuration provided requires plugins which can't be located,\r\ndon't satisfy the version constraints, or are otherwise incompatible.\r\n\r\n1 error(s) occurred:\r\n\r\n* provider.terraform: this provider is built in to Terraform and so it does not support version constraints\r\n\r\nTerraform automatically discovers provider requirements from your\r\nconfiguration, including providers used in child modules. To see the\r\nrequirements and constraints from each module, run \"terraform providers\".\r\n\r\n\r\nError: error satisfying plugin requirements\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\n1. (Implicitly) use the `\"terraform\"` provider\r\n2. `terraform init`\r\n3. Get told to add a version to the provider\r\n4. Add a provider block with a version for the `\"terraform\"` provider.\r\n5. `terraform plan`\r\n\r\n### References\r\n\r\n- #16994\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/371872786","html_url":"https://github.com/hashicorp/terraform/issues/17473#issuecomment-371872786","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/17473","id":371872786,"user":{"login":"apparentlymart","id":20180,"avatar_url":"https://avatars1.githubusercontent.com/u/20180?v=4","gravatar_id":"","url":"https://api.github.com/users/apparentlymart","html_url":"https://github.com/apparentlymart","followers_url":"https://api.github.com/users/apparentlymart/followers","following_url":"https://api.github.com/users/apparentlymart/following{/other_user}","gists_url":"https://api.github.com/users/apparentlymart/gists{/gist_id}","starred_url":"https://api.github.com/users/apparentlymart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apparentlymart/subscriptions","organizations_url":"https://api.github.com/users/apparentlymart/orgs","repos_url":"https://api.github.com/users/apparentlymart/repos","events_url":"https://api.github.com/users/apparentlymart/events{/privacy}","received_events_url":"https://api.github.com/users/apparentlymart/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T16:57:10Z","updated_at":"2018-03-09T16:57:10Z","author_association":"CONTRIBUTOR","body":"Hi @ivan-m! Thanks for that additional information.\r\n\r\nIn that log output I see lines like this:\r\n\r\n```\r\n[DEBUG] found valid plugin: \"terraform\", \"1.0.2\", \"/nix/store/bsk5z0nbpb0mnbh1wq9hbyia519bin85-tf-plugin-env/bin/terraform-provider-terraform_v1.0.2\"\r\n```\r\n\r\nThis confirms @jbardin's theory about this being caused by there being an old, separated provider binary that is confusing Terraform's installer now that the `terraform` plugin is built in to Terraform itself (as of v0.11).\r\n\r\nI'm going to close this one just to consolidate into #17233, where this is already being discussed. Sorry for this confusing bug, and thanks for reporting it.\r\n"}}
{"actor":{"display_login":"apparentlymart"}}