Terraform: Error getting plugins: module "container_linux": missing required argument "version"

Created on 6 Dec 2017  ยท  9Comments  ยท  Source: hashicorp/terraform

Terraform Version

Terraform v0.11.1
+ provider.archive v1.0.0
+ provider.external v1.0.0
+ provider.ignition v0.1.0
+ provider.local v1.0.0
+ provider.null v1.0.0
+ provider.random v1.0.0
+ provider.template v1.0.0
+ provider.tls v1.0.0

Terraform Configuration Files

...

Debug Output

Crash Output

Expected Behavior

Actual Behavior

I am trying to install tectonic, terraform is the prerequisite. I am on Ubuntu 16.04

$ terraform init ./platforms/metal
Initializing modules...
- module.container_linux
- module.ignition_masters
- module.ignition_workers
- module.kube_certs
- module.etcd_certs
- module.ingress_certs
- module.identity_certs
- module.bootkube
- module.tectonic
- module.flannel_vxlan
- module.calico
- module.canal
Error getting plugins: module "container_linux": missing required argument "version"

Steps to Reproduce

Important Factoids

References

config

Most helpful comment

Hi @MilenkoM! Sorry for this error.

Unfortunately as of Terraform 0.11.0 the name version is reserved inside module blocks to represent the Terraform module version when installing from a module registry. It looks like Tectonic is using this name for an input variable for a module, which is no longer possible in 0.11.0.

Until Tectonic is updated to address this naming conflict, I think it will be necessary to use Terraform 0.10.8, which is the newest release where version is not a reserved name within module blocks.

All 9 comments

Hi @MilenkoM! Sorry for this error.

Unfortunately as of Terraform 0.11.0 the name version is reserved inside module blocks to represent the Terraform module version when installing from a module registry. It looks like Tectonic is using this name for an input variable for a module, which is no longer possible in 0.11.0.

Until Tectonic is updated to address this naming conflict, I think it will be necessary to use Terraform 0.10.8, which is the newest release where version is not a reserved name within module blocks.

It looks like this has now been addressed in coreos/tectonic-installer#2471, with this module now using release_version instead of just version as the name for this input variable.

IMO, throwing a "reserved_word" error would be nice.

In my projects, I've been using version a lot in module, like this

variable "version" {
  description = "The application version"
  default     = "latest"
}

and it took me a while to find out that this variable always come out with the default value, which causes me some trouble

@apparentlymart what do you think we throw an error here?

I just ran into this exact same error in a module I am writing. Thank goodness this issue was here to tell me I simply need to rename my variable. I think a "reserved word" error would be wonderful, as the current wording is quite misleading.

We also use version as an input variable in many modules. Disappointed to see such a generic reserved word introduced.

+1 on calls for a more specific error message.

Instead of:

Error getting plugins: module "foo": missing required argument "version"

It could be:

Error getting plugins: module "foo": uses reserved keyword "version" for a variable. Please change this to something else.

I just tripped on this too while upgrading to TF 0.11.

I think this should to be documented in the upgrade guide (https://www.terraform.io/upgrade-guides/0-11.html), along with other breaking changes listed in the CHANGELOG (https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#0110-november-16-2017).

I think the error terraform throws should indicate that it's a reserved keyword too now. The error is extremely misleading.

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.

Was this page helpful?
0 / 5 - 0 ratings