Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Resource node has no configuration attached #21757

Closed
nickmhankins opened this issue Jun 17, 2019 · 8 comments · Fixed by #22098
Closed

Error: Resource node has no configuration attached #21757

nickmhankins opened this issue Jun 17, 2019 · 8 comments · Fixed by #22098

Comments

@nickmhankins
Copy link

nickmhankins commented Jun 17, 2019

Terraform Version

Terraform v0.12.2

Debug Output

I have the trace output but would prefer not to post it here - even encrypted. It contains a lot of sensitive information. Is there an email address @hashicorp I can send it to instead?

Expected Behavior

Successful plan should have applied

Actual Behavior

Received error message for seemingly every resource in every module:

Error: Resource node has no configuration attached

The graph node for
module.aas_resources.module.aas_vm_avzone_creation.azurerm_virtual_machine_extension.oms_extension[0]
has no configuration attached to it. This suggests a bug in Terraform's apply
graph builder; please report it!

Error: Resource node has no configuration attached

The graph node for
module.hana_resources.module.hana_vm_avzone_creation.azurerm_virtual_machine_data_disk_attachment.disk_attachments[7]
has no configuration attached to it. This suggests a bug in Terraform's apply
graph builder; please report it!

Error: Resource node has no configuration attached

The graph node for
module.ci_resources.module.ci_vm_avzone_creation.azurerm_network_interface.nic[0]
has no configuration attached to it. This suggests a bug in Terraform's apply
graph builder; please report it!

Error: Resource node has no configuration attached

The graph node for
module.ci_resources.module.ci_vm_avzone_creation.azurerm_virtual_machine_data_disk_attachment.disk_attachments[3]
has no configuration attached to it. This suggests a bug in Terraform's apply
graph builder; please report it!

Steps to Reproduce

terraform init
terraform plan
terraform apply

Additional Context

We have around 4 layers of modules so it's hard to post a code snippet to describe the problem. The plan comes back green and it looks like everything it wants to create is what it should be creating. Everything worked as it should under TF 0.11.14, we are working through 0.12 changes so we can utilize the new version.

Workaround

I was able to workaround the issue by not using an output file from terraform plan and just doing an apply. Unfortunately that is not going to work for us because our pipeline automation doesn't work that way.

@word
Copy link

word commented Jun 25, 2019

I came across a similar issue and it was due to an input variable having a wrong type set. It was:

variable "example" {                                                                                                                                                                    
  type  = "boolean"
}

changed it to:

variable "example" {                                                                                                                                                                    
  type  = bool
}

without the quotes. Not sure if that's the same issue but I had the exact same symptoms. I'd review your input types first as per: https://www.terraform.io/docs/configuration/variables.html

@word
Copy link

word commented Jun 25, 2019

I can reproduce this reliably by specifying invalid type in 0.12.3:

variable "vpc_cidr" {
  type = invalidtype
}

plan works, apply with plan file fails:

<SNIP>
Error: orphan resource module.srv-vpc.module.vpc.aws_route.nat still has a non-empty state after apply; this is a bug in Terraform

Error: orphan resource module.srv-vpc.module.vpc.aws_internet_gateway.igw still has a non-empty state after apply; this is a bug in Terraform
<SNIP>

Apply without a plan file seems to work. This should error during plan and display a sensible message.

@dyegoe
Copy link

dyegoe commented Jun 28, 2019

I don't know what exactly the steps that I did but I got the same errors and the same workaround worked for me.

@Esya
Copy link

Esya commented Jul 4, 2019

We've had the same issue here after upgrading to 0.12 - and the problem was that we defined the same attribute twice on the same ressource :

resource "aws_alb_target_group" "instance_tg" {
  target_type = "ip"
  name        = "admin-${var.env_name}-tg"
  protocol    = "HTTP"
  port        = "80"
  vpc_id      = "${var.vpc_id}"

  health_check {
    path = "/"
  }
  target_type = "ip"

}

We removed the extra "target_type" and it works again

@sarneaud
Copy link

I've produced it in 0.12 with a duplicate locals section.

@dyegoe
Copy link

dyegoe commented Jul 11, 2019

@sarneaud nice clue. Just to clarify, did you write your locals in one terraform and in a module (that you did)?

@sarneaud
Copy link

No, I have multiple locals in multiple modules and files and it's normally not a problem. As a part of some refactoring, one got duplicated verbatim.

It looks like a lot of mistakes like this are showing up as "no configuration attached" errors during apply in 0.12. Unfortunately, it can be pretty hard to debug.

@ghost
Copy link

ghost commented Aug 16, 2019

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.

@ghost ghost locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants