0.10.2
# Copy-paste your Terraform configurations here.
#
# For large Terraform configs, please use a service like Dropbox and
# share a link to the ZIP file. For security, you can also encrypt the
# files using our GPG public key.
Main: https://gitlab.com/Flockademic/Flockademic/blob/39348abba57d54bbae8613a7c98b948a0798bb6a/stacks.tf
Which also refers to:
This was in CI so I don't have full debug output, but you can see the graph and plan in the console output: https://gitlab.com/Flockademic/Flockademic/-/jobs/39886277
Note that the same config has worked successfully for many other commits already.
No error messages telling me to report a bug.
Error applying plan:
2 error(s) occurred:
* module.periodicals.aws_lambda_function.periodicals_lambda: aws_lambda_function.periodicals_lambda: 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.10.2
Resource ID: aws_lambda_function.periodicals_lambda
Mismatch reason: attribute mismatch: source_code_hash
Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"source_code_hash":*terraform.ResourceAttrDiff{Old:"DSHeKmDA06FGms9QirmvMcxHC3uwesa4h9frWSpfvdg=", New:"5fbcft7nzfr5vdWLCoiTBNsDX36flBilQt4lqP5EGS4=", 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(nil), 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.
* module.accounts.aws_lambda_function.accounts_lambda: aws_lambda_function.accounts_lambda: 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.10.2
Resource ID: aws_lambda_function.accounts_lambda
Mismatch reason: attribute mismatch: source_code_hash
Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"source_code_hash":*terraform.ResourceAttrDiff{Old:"+THayxiz7yUXk+dLGIAG5dGVckEJrqYqdiRKBWuTCFQ=", New:"pQrRjnlaYgl9VwEaL5DGkmVMR/Z1V5e2sJgI8xISGS0=", 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(nil), Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
I don't really know...
Running in CI. Retrying was successful.
I have a similar behavior by decreasing the instances attached to an elb. If this is too different from the problem mentioned above, I can open a separate issue, but it seemed quite similar.
Terraform version: 0.10.2
Expected Behavior
No errors when instances of the elb are decreased due to changing the count variable of the instances.
Actual Behavior
* module.aws.aws_elb.web: aws_elb.web: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHubIssue.
Please include the following information in your report:
Terraform Version: 0.10.8
Resource ID: aws_elb.web
Mismatch reason: attribute mismatch: instances.1424219465
Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"instances.4025163768":*terraform.ResourceAttrDiff{Old:"i-0bc39689fef0300e4", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.1424219465":*terraform.ResourceAttrDiff{Old:"i-056b9a1d5b292ef2a", New:"i-056b9a1d5b292ef2a", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.#":*terraform.ResourceAttrDiff{Old:"7", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.2514422359":*terraform.ResourceAttrDiff{Old:"i-01362a6c1da31724e", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.2773104058":*terraform.ResourceAttrDiff{Old:"i-0dd45200001d77c52", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.2100288283":*terraform.ResourceAttrDiff{Old:"i-0380545626fdc87ad", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.3317007677":*terraform.ResourceAttrDiff{Old:"i-03e0539e630945089", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.509595657":*terraform.ResourceAttrDiff{Old:"i-0e01a0155f4cfb9bf", New:"", NewComputed:false, NewRemoved:true, 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{"instances.#":*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)}
Also include as much context as you can about your config, state, and the steps you performed to trigger this error.
Steps to Reproduce:
Decrease the number of instances of the elb.
Important Factoids:
After re-running terraform apply the error does not appear any more. The tfstate file is also correc
I'm implementing docker swarm for the docker-provider, hence I want to dynamically change the number of workers in the swarm and attach the instances to the elb
resource "aws_elb" "web" {
...
instances = [
"${concat(list(module.bootstrap_manager.id),
module.managers.ids,
module.workers.ids)}",
]
...
just ran into the same issue.
Error: Error applying plan:
1 error(s) occurred:
* module.elb.aws_elb.elb: aws_elb.elb: 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.10.8
Resource ID: aws_elb.elb
Mismatch reason: attribute mismatch: instances.#
Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"instances.1901399340":*terraform.ResourceAttrDiff{Old:"i-0c6af8141634ff6b1", New:"i-0c6af8141634ff6b1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.859596546":*terraform.ResourceAttrDiff{Old:"i-091b5dc5471e5c8e1", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.2268853288":*terraform.ResourceAttrDiff{Old:"i-0b32a848c7d9f69a5", New:"i-0b32a848c7d9f69a5", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.2072189744":*terraform.ResourceAttrDiff{Old:"i-0d4f6b9377fccf39f", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.#":*terraform.ResourceAttrDiff{Old:"8", New:"3", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.710225761":*terraform.ResourceAttrDiff{Old:"i-09d5fbd1b25c809b2", New:"i-09d5fbd1b25c809b2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.1672254292":*terraform.ResourceAttrDiff{Old:"i-0dd0fb8ee81cf171b", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.3271768535":*terraform.ResourceAttrDiff{Old:"i-016ced761f29f7389", New:"", NewComputed:false, NewRemoved:true, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instances.3083787250":*terraform.ResourceAttrDiff{Old:"i-03c43b81458d308ff", New:"", NewComputed:false, NewRemoved:true, 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(nil), 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.
Same issue when updating the count of instances or adding any variable.
using s3 as backend to store state..
Same issue but with lambda source code hash
Please include the following information in your report:
Terraform Version: 0.11.8
Resource ID: aws_lambda_function.lambda1
Mismatch reason: attribute mismatch: source_code_hash
Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0},
Any update on this issue or any workaround for this. As I am kind of stuck and terraform apply fails everytime. Here I am using plan.tfplan to plan first and then use this plan.tfplan for apply as well. Can this be reason of issue. Any help is much appreciated.
* module.monitor_function.aws_lambda_function.lambda: aws_lambda_function.lambda: 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.7
Resource ID: aws_lambda_function.lambda
Mismatch reason: attribute mismatch: source_code_hash
Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"source_code_hash":*terraform.ResourceAttrDiff{Old:"qk/Ekq87vKGr0jLR56W4NQJw0K3D0JPiLNazZ1mOy1Q=", New:"rY9zp5pnM7u9E71CtsMU4dfkgOQ41BpHzpjJ+yTM79E=", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "last_modified":*terraform.ResourceAttrDiff{Old:"2018-10-18T09:50:13.400+0000", 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)}
[10:12:09][Step 3/5] Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff(nil), Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
For an aws.lambda resource, initially use the output_md5 as the source_code_hash:
source_code_hash = "${data.archive_file.package.output_md5}"
This was applied successfully many times over. I then switched to base64SHA256:
source_code_hash = "${base64sha256(file(data.archive_file.package.output_path))}"
The apply results in the error above.
I destroyed the lambda and re-ran the apply, similar to this.
terraform plan -destroy -target=module.monitor_function -out 1.plan
terraform apply 1.plan
terraform plan -out 2.plan
terraform apply 2.plan
Subsequent deployments have been working fine with base64SHA256.
Hello!
Thanks for reporting this issue. Unfortunately the error output in this "diffs didn't match" situation is often not enough to diagnose the problem. Starting in 0.12 the situation that causes this error is more precisely reported, and the necessary debugging information is recorded in the logs. If this issue persists after upgrading Terraform, please file an issue with the referenced provider.
Thanks
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.
Most helpful comment
I have a similar behavior by decreasing the instances attached to an
elb. If this is too different from the problem mentioned above, I can open a separate issue, but it seemed quite similar.Terraform version: 0.10.2
Expected Behavior
No errors when instances of the
elbare decreased due to changing thecountvariable of the instances.Actual Behavior
Steps to Reproduce:
Decrease the number of instances of the
elb.Important Factoids:
After re-running
terraform applythe error does not appear any more. Thetfstatefile is also correcI'm implementing docker swarm for the
docker-provider, hence I want to dynamically change the number of workers in the swarm and attach the instances to theelb