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

terraform: Error during apply - diffs didn't match during apply #21012

Closed
Aussie007 opened this issue Apr 15, 2019 · 15 comments
Closed

terraform: Error during apply - diffs didn't match during apply #21012

Aussie007 opened this issue Apr 15, 2019 · 15 comments
Labels
bug core v0.11 Issues (primarily bugs) reported against v0.11 releases

Comments

@Aussie007
Copy link

Aussie007 commented Apr 15, 2019

Terraform Version

Terraform v0.11.13
+ provider.aws v2.6.0

Expected Behavior

The terraform apply should have completed with no errors

Actual Behavior

Received an error during apply:

Error: Error applying plan:

1 error(s) occurred:

* module.eks_stack.aws_autoscaling_group.as_node_group: aws_autoscaling_group.as_node_group: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

Please include the following information in your report:

    Terraform Version: 0.11.13
    Resource ID: aws_autoscaling_group.as_node_group
    Mismatch reason: attribute mismatch: availability_zones.1924028850
    Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"availability_zones.3953592328":*terraform.ResourceAttrDiff{Old:"", New:"eu-west-1a", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "load_balancers.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "service_linked_role_arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "desired_capacity":*terraform.ResourceAttrDiff{Old:"", New:"3", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "force_delete":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "launch_configuration":*terraform.ResourceAttrDiff{Old:"", New:"${aws_launch_configuration.as_lc_node_group.id}", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "name":*terraform.ResourceAttrDiff{Old:"", New:"edw-uat-eks-eu-worker-nodes-node-group", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "metrics_granularity":*terraform.ResourceAttrDiff{Old:"", New:"1Minute", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "health_check_grace_period":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "wait_for_capacity_timeout":*terraform.ResourceAttrDiff{Old:"", New:"10m", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "protect_from_scale_in":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "health_check_type":*terraform.ResourceAttrDiff{Old:"", New:"EC2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "max_size":*terraform.ResourceAttrDiff{Old:"", New:"5", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "default_cooldown":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "min_size":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "availability_zones.1924028850":*terraform.ResourceAttrDiff{Old:"", New:"eu-west-1b", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "availability_zones.94988580":*terraform.ResourceAttrDiff{Old:"", New:"eu-west-1c", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "target_group_arns.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "availability_zones.#":*terraform.ResourceAttrDiff{Old:"", New:"3", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "vpc_zone_identifier.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
    Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"name":*terraform.ResourceAttrDiff{Old:"", New:"edw-uat-eks-eu-worker-nodes-node-group", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "metrics_granularity":*terraform.ResourceAttrDiff{Old:"", New:"1Minute", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "load_balancers.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "wait_for_capacity_timeout":*terraform.ResourceAttrDiff{Old:"", New:"10m", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "force_delete":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "max_size":*terraform.ResourceAttrDiff{Old:"", New:"5", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "protect_from_scale_in":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "vpc_zone_identifier.3021877123":*terraform.ResourceAttrDiff{Old:"", New:"subnet-01ba29c93c4bb7c77", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "health_check_grace_period":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "target_group_arns.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "vpc_zone_identifier.#":*terraform.ResourceAttrDiff{Old:"", New:"3", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "min_size":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "default_cooldown":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false,
Type:0x0}, "desired_capacity":*terraform.ResourceAttrDiff{Old:"", New:"3", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "vpc_zone_identifier.2776499959":*terraform.ResourceAttrDiff{Old:"", New:"subnet-055a31b6f314f3c1d", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "service_linked_role_arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "launch_configuration":*terraform.ResourceAttrDiff{Old:"", New:"edw-uat-eks-eu-20190415092811596400000006", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "health_check_type":*terraform.ResourceAttrDiff{Old:"", New:"EC2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "vpc_zone_identifier.3615222509":*terraform.ResourceAttrDiff{Old:"", New:"subnet-0cb37dd8b182bdb9c", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:
Also include as much context as you can about your config, state, and the steps you performed to trigger this error.

Steps to Reproduce

  1. terraform apply

Additional Context

Using AWS Provider v2.6.0
I have an AWS Auto Scaling Group with a "depends_on" to an AWS EKS Cluster

@apparentlymart
Copy link
Contributor

Hi @Aussie007! Sorry for this error, and thanks for reporting it.

Could you please share the configuration for aws_autoscaling_group.as_node_group? This error means that some other resource changed its result between the plan phase and the apply phase, and that result was used as part of the configuration of availability_zones here and so Terraform detected an inconsistency between what was planned and what it ultimately was asked to apply.

This suggests a bug in whatever other resource type has changed its outputs between the two phases, since a provider is required to provide an accurate plan in order for Terraform to complete successfully. Therefore by looking at your configuration I'm hoping to learn which provider contains the resource type in question (I expect it's some other resource type in the AWS provider, but want to confirm first) so that we can file this issue against whichever provider has that bug.

If there are no references in your availability_zones setting then that suggests some other issue, which we can dig into once we can see exactly how your configuration looks.

Thanks!

@apparentlymart apparentlymart added the waiting-response An issue/pull request is waiting for a response from the community label Apr 15, 2019
@Aussie007
Copy link
Author

Aussie007 commented Apr 16, 2019

Hi @apparentlymart

No problem. I use a "data" resource to get the available AWS AZs in the current region:

data "aws_availability_zones" "available" {}

This is then referenced by the ASG:

resource "aws_autoscaling_group" "as_node_group" {
  name_prefix = "${var.region_prefix}-${var.icao_code}-worker-nodes-node-group-"
  availability_zones = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}", "${data.aws_availability_zones.available.names[2]}"]
  desired_capacity   = 3
  max_size           = 5
  min_size           = 2
  health_check_type  = "EC2"
  health_check_grace_period = 0
  vpc_zone_identifier = ["${aws_subnet.subnet_private_01.id}", "${aws_subnet.subnet_private_02.id}", "${aws_subnet.subnet_private_03.id}"]
  
  launch_configuration = "${aws_launch_configuration.as_lc_node_group.id}"

  tags = [
      {
        key                 = "Name"
        value               = "${var.region_prefix}-${var.icao_code}-worker-nodes"
        propagate_at_launch = true
      },
      {
        key                 = "kubernetes.io/cluster/${var.region_prefix}-${var.icao_code}"
        value               = "owned"
        propagate_at_launch = true
      }
  ]

  lifecycle {
    create_before_destroy = true
  }

  depends_on = ["aws_eks_cluster.eks"]
}

Let me know if you need any further information.

Cheers!

@ghost ghost removed the waiting-response An issue/pull request is waiting for a response from the community label Apr 16, 2019
@Aussie007
Copy link
Author

Hi @apparentlymart

Just more detail - when I run "terraform apply" a second time, I have no error/issue and all configurations are applied fine.

Cheers!

@apparentlymart
Copy link
Contributor

Hi @Aussie007! Thanks for the extra context.

We've not seen this issue arise with data resources before, so this appears to be a new problem. I'm going to keep this in the Terraform Core repository (this one) for now until we can learn more about what is going on here, since based only on the error message it seems like somehow the data result changed between plan and apply, and yet that isn't supposed to be possible.

@jlucktay
Copy link

I hit a similar error with a VM on Azure:

* module.DEGUT1APM33.azurerm_virtual_machine.main: azurerm_virtual_machine.main: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

Please include the following information in your report:

    Terraform Version: 0.11.13
    Resource ID: azurerm_virtual_machine.main
    Mismatch reason: attribute mismatch: network_interface_ids.#

I can submit all of the additional gory details here, or in another (new?) issue?

@apparentlymart
Copy link
Contributor

Hi @jlucktay!

If your configuration for network_interface_ids includes a reference to a data resource (something starting with data.) then that suggests possibly the same issue as this one, but if you're instead referring to a managed resource (that is, something declared with a resource block rather than a data block) then it'd be a bug in whatever provider that resource type belongs to.

If the latter, I'd suggest opening an issue about it in that provider. (Note that it's the provider that network_interface_ids is popualted from, not the provider that azurerm_virtual_machine itself belongs to, though in this case I expect it's probably still the azurerm provider, because nothing else would be creating Azure network interfaces.)

@annakhm
Copy link

annakhm commented May 7, 2019

Hi @apparentlymart, I'm hitting similar issue with terraform-provider-nsxt, when removing a nested object on a resource that hits ForceNew. As @Aussie007 mentioned above, second apply succeeds. Data sources are not involved in my case though.

@apparentlymart
Copy link
Contributor

Hi @annakhm,

Since in your case data sources are not involved, that seems like a different problem. I'd suggest opening an issue in the nxst provider repository and including the source code of the resource block for the resource indicated in the error; the usual cause of this bug is that the implementation of a resource you are interpolating from (in the provider code) is not producing an accurate plan, and so during apply the outcome did not match what was planned, which Terraform 0.11 reports with this error. (The forthcoming Terraform 0.12 has a different error for this situation which detects it sooner, resulting in a more helpful error message.)

annakhm added a commit to vmware/terraform-provider-nsxt that referenced this issue May 7, 2019
The test is failing due to what seems to be issue in core terraform
hashicorp/terraform#21012

This patch is a workaround to avoid test failure while the issue is
investigated.
@annakhm
Copy link

annakhm commented May 7, 2019

Hi @apparentlymart, thanks for quick reply - does it make sense that second apply succeeds in case the issue is in the provider?

@apparentlymart
Copy link
Contributor

Yes, this issue will generally tend to resolve itself on second apply regardless of root cause, because it results from something unexpected happening during the apply phase, but on the second run that unexpected thing already happened and so the plan will be correct on the first try.

@miroadamy
Copy link

miroadamy commented May 8, 2019

Just got this:

Error: Error applying plan:

1 error(s) occurred:

* module.dyndb_dive_tenant.aws_dynamodb_table.table: aws_dynamodb_table.table: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

Please include the following information in your report:

    Terraform Version: 0.11.13
    Resource ID: aws_dynamodb_table.table
    Mismatch reason: attribute mismatch: range_key
    Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"name":*terraform.ResourceAttrDiff{Old:"dive-tenant-alpha", New:"dive-tenant-alpha", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.environment":*terraform.ResourceAttrDiff{Old:"alpha", New:"alpha", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "attribute.842430865.name":*terraform.ResourceAttrDiff{Old:"tenantId", New:"tenantId", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "hash_key":*terraform.ResourceAttrDiff{Old:"tenantId", New:"tenantId", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.content_type":*terraform.ResourceAttrDiff{Old:"data", New:"data", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "write_capacity":*terraform.ResourceAttrDiff{Old:"0", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"4", New:"4", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "stream_label":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "stream_view_type":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:"", RequiresNew:false, Sensitive:false, Type:0x0}, "range_key":*terraform.ResourceAttrDiff{Old:"folder", New:"", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "attribute.842430865.type":*terraform.ResourceAttrDiff{Old:"S", New:"S", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "point_in_time_recovery.0.enabled":*terraform.ResourceAttrDiff{Old:"true", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "billing_mode":*terraform.ResourceAttrDiff{Old:"PAY_PER_REQUEST", New:"PAY_PER_REQUEST", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "attribute.1927589884.type":*terraform.ResourceAttrDiff{Old:"S", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "server_side_encryption.#":*terraform.ResourceAttrDiff{Old:"0", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.tenant_id":*terraform.ResourceAttrDiff{Old:"000000", New:"000000", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "attribute.1927589884.name":*terraform.ResourceAttrDiff{Old:"folder", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "attribute.#":*terraform.ResourceAttrDiff{Old:"2", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.app_type":*terraform.ResourceAttrDiff{Old:"dive", New:"dive", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "point_in_time_recovery.#":*terraform.ResourceAttrDiff{Old:"1", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "server_side_encryption.0.enabled":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "stream_arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"arn:aws:dynamodb:us-west-2:442460237119:table/dive-tenant-alpha", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "stream_enabled":*terraform.ResourceAttrDiff{Old:"false", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "read_capacity":*terraform.ResourceAttrDiff{Old:"0", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
    Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"attribute.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "write_capacity":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "attribute.842430865.type":*terraform.ResourceAttrDiff{Old:"", New:"S", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "attribute.842430865.name":*terraform.ResourceAttrDiff{Old:"", New:"tenantId", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "stream_arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "arn":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "billing_mode":*terraform.ResourceAttrDiff{Old:"", New:"PAY_PER_REQUEST", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "stream_view_type":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:"", RequiresNew:false, Sensitive:false, Type:0x0}, "tags.tenant_id":*terraform.ResourceAttrDiff{Old:"", New:"000000", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.content_type":*terraform.ResourceAttrDiff{Old:"", New:"data", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "server_side_encryption.0.enabled":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "point_in_time_recovery.0.enabled":*terraform.ResourceAttrDiff{Old:"", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.app_type":*terraform.ResourceAttrDiff{Old:"", New:"dive", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "stream_enabled":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "read_capacity":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "name":*terraform.ResourceAttrDiff{Old:"", New:"dive-tenant-alpha", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "point_in_time_recovery.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "server_side_encryption.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.environment":*terraform.ResourceAttrDiff{Old:"", New:"alpha", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "stream_label":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "hash_key":*terraform.ResourceAttrDiff{Old:"", New:"tenantId", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"", New:"4", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}

Also include as much context as you can about your config, state, and the steps you performed to trigger this error.


Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.


@apparentlymart
Copy link
Contributor

Hi all,

I do appreciate your taking the time to look for similar issues when reporting further occurrences of "diffs didn't match during apply", but unfortunately in this particular case it seems that there are at least two different classes of bug that are reflected by this same error, and so adding more on here without all of the context requested in our issue template doesn't give enough information to determine where the problem lies and thus to triage into the appropriate codebase.

The best thing to do when you get an error of this type is to open an issue in the repository for the provider involved. If you see Mismatch reason: attribute mismatch: in the error message as above, the indicated attribute in the configuration likely contains a reference (direct or indirect) to some other resource in your configuration, and in most cases it is that resource that has the bug, and so the provider that implements that resource type is the best place to open an issue.

If it's not clear from reading your configuration which resource is being used to resolve that value, then the second best thing to do is to open a new bug report issue and include all of the information requested in the template. We ask for that information because it gives us what we need in order to triage the problem and see whether it's a bug in a specific provider or a general bug in Terraform. The error message alone unfortunately does not give enough information for full triage.

(The situation will change here once Terraform 0.12 is released. We've moved the check that displays this error into a different codepath so that it has more information available and can report the specific resource type and provider that the problem originated from. Hopefully it should be much easier to triage this class of problem into the appropriate codebase with the information provided in that new error message.)

@Aussie007
Copy link
Author

Aussie007 commented Aug 7, 2019

Hi @apparentlymart

Just providing an update in this.

I have updated Terraform and my AWS provider:

Terraform v0.12.6
+ provider.aws v2.22.0

I still have the issue, but it is appears to be reported slightly differently (possibly due to the error handling in Terraform v0.12.x

Error: Provider produced inconsistent final plan

When expanding the plan for
module.eks_stack.aws_autoscaling_group.as_node_group to include new values
learned so far during apply, provider "aws" produced an invalid new value for
.availability_zones: was known, but now unknown.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

This is now suggesting the issue is within the provider.

Do you want me to close this issue and open a new one in the AWS provider Github?

Regards

@teamterraform
Copy link
Contributor

Hi @Aussie007,

Thanks for the update.
As you can see, the new errors better pinpoint where the problem lies. Since now we have a good indication of what was actually causing the error, it's best to move this to the provider repo itself.

Thanks!

@hashibot hashibot added the v0.11 Issues (primarily bugs) reported against v0.11 releases label Aug 22, 2019
@ghost
Copy link

ghost commented Sep 28, 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 Sep 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug core v0.11 Issues (primarily bugs) reported against v0.11 releases
Projects
None yet
Development

No branches or pull requests

7 participants