-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Internal error when metadata refers to variable #634
Comments
@mitchellh @armon this is related to the logic in the The issue is that the schema defines a So in the end the second diff will contain more keys as the first one without any sane way to tell if these are valid (because they are now computed) or that the diff is actually different and something is wrong. For this I (atm) only see 2 possible solutions...
So what is your take on this? Which would be the preferred solution or do you see any other viable solutions? |
For reference, these are the keys that cause the diff error here:
|
I don't seem to suffer this bug anymore. |
@mitchellh not having much time to do some functional testing right now, so from the top of your head do you think the behaviour as described above could be changed/solved by the fieldreader/writer changes in helper/schema? If so, I think we can close this one... |
Perhaps so but I jus want to verify. |
Of course... Was just wondering if you could tell by heart if this behaviour should be changed or that it shouldn't be related... |
Yeah off the top of my head I'm not 100%. I'm wondering if maybe this was fixed by all those smaller fixes we did @svanharmelen. But not sure. |
This is fixed. |
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. |
The following tf file yields the error below:
2014/12/09 15:30:00 [INFO] Terraform version: 0.3.2 dev bf3d16a
2014/12/09 15:30:00 Detected home directory from env var: /home/dcunnin
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: aws = /home/dcunnin/go-workspace/bin/terraform-provider-aws
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: cloudflare = /home/dcunnin/go-workspace/bin/terraform-provider-cloudflare
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: consul = /home/dcunnin/go-workspace/bin/terraform-provider-consul
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: digitalocean = /home/dcunnin/go-workspace/bin/terraform-provider-digitalocean
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: dnsimple = /home/dcunnin/go-workspace/bin/terraform-provider-dnsimple
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: google = /home/dcunnin/go-workspace/bin/terraform-provider-google
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: heroku = /home/dcunnin/go-workspace/bin/terraform-provider-heroku
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: mailgun = /home/dcunnin/go-workspace/bin/terraform-provider-mailgun
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: null = /home/dcunnin/go-workspace/bin/terraform-provider-null
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: file = /home/dcunnin/go-workspace/bin/terraform-provisioner-file
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: local-exec = /home/dcunnin/go-workspace/bin/terraform-provisioner-local-exec
2014/12/09 15:30:00 [DEBUG] Discoverd plugin: remote-exec = /home/dcunnin/go-workspace/bin/terraform-provisioner-remote-exec
2014/12/09 15:30:00 Detected home directory from env var: /home/dcunnin
2014/12/09 15:30:00 [DEBUG] Attempting to open CLI config file: /home/dcunnin/.terraformrc
2014/12/09 15:30:00 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2014/12/09 15:30:00 [DEBUG] Creating graph for path: [root]
2014/12/09 15:30:00 [DEBUG] Starting plugin: /home/dcunnin/go-workspace/bin/terraform-provider-google []string{"/home/dcunnin/go-workspace/bin/terraform-provider-google"}
2014/12/09 15:30:00 Detected home directory from env var: /home/dcunnin
2014/12/09 15:30:00 [DEBUG] Waiting for RPC address for: /home/dcunnin/go-workspace/bin/terraform-provider-google
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 Plugin address: unix /tmp/tf-plugin087511946
2014/12/09 15:30:00 [DEBUG] Graph [root] created and valid. 4 nouns.
2014/12/09 15:30:00 [DEBUG] Creating graph for path: [root]
2014/12/09 15:30:00 [DEBUG] Graph [root] created and valid. 4 nouns.
2014/12/09 15:30:00 [INFO] Validating provider: google
2014/12/09 15:30:00 [DEBUG] google_compute_address.test: expanding to count = 1
2014/12/09 15:30:00 [INFO] Validating resource: google_compute_address.test
2014/12/09 15:30:00 [DEBUG] google_compute_instance.default: expanding to count = 1
2014/12/09 15:30:00 [INFO] Validating resource: google_compute_instance.default
2014/12/09 15:30:00 [INFO] Writing backup state to: terraform.tfstate.backup
2014/12/09 15:30:00 [DEBUG] Creating graph for path: [root]
2014/12/09 15:30:00 [DEBUG] Graph [root] created and valid. 4 nouns.
2014/12/09 15:30:00 [INFO] Configuring provider: google
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] Requesting Google token...
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Email: 1005268309260-dnidkmrpu9kvkvopi3l52sjluq75gimp@developer.gserviceaccount.com
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Scopes: https://www.googleapis.com/auth/compute
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Private Key Length: 916
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Token URL:
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] Instantiating GCE client...
2014/12/09 15:30:00 [DEBUG] google_compute_address.test: expanding to count = 1
2014/12/09 15:30:00 [INFO] Module root walking: google_compute_address.test (Graph node: google_compute_address.test)
2014/12/09 15:30:00 [DEBUG] google_compute_address.test: Not refreshing, ID is empty
2014/12/09 15:30:00 [DEBUG] google_compute_instance.default: expanding to count = 1
2014/12/09 15:30:00 [INFO] Module root walking: google_compute_instance.default (Graph node: google_compute_instance.default)
2014/12/09 15:30:00 [DEBUG] google_compute_instance.default: Not refreshing, ID is empty
2014/12/09 15:30:00 [DEBUG] Creating graph for path: [root]
2014/12/09 15:30:00 [DEBUG] Graph [root] created and valid. 4 nouns.
2014/12/09 15:30:00 [INFO] Configuring provider: google
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] Requesting Google token...
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Email: 1005268309260-dnidkmrpu9kvkvopi3l52sjluq75gimp@developer.gserviceaccount.com
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Scopes: https://www.googleapis.com/auth/compute
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Private Key Length: 916
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Token URL:
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] Instantiating GCE client...
2014/12/09 15:30:00 [DEBUG] google_compute_address.test: expanding to count = 1
2014/12/09 15:30:00 [INFO] Module root walking: google_compute_address.test (Graph node: google_compute_address.test)
2014/12/09 15:30:00 [DEBUG] google_compute_address.test: Executing diff
2014/12/09 15:30:00 [DEBUG] google_compute_address.test: Diff: &terraform.InstanceDiff{Attributes:map[string]_terraform.ResourceAttrDiff{"name":_terraform.ResourceAttrDiff{Old:"", New:"test", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "address":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "selfLink":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "id":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x2}}, Destroy:false, DestroyTainted:false}
2014/12/09 15:30:00 [DEBUG] google_compute_instance.default: expanding to count = 1
2014/12/09 15:30:00 [INFO] Module root walking: google_compute_instance.default (Graph node: google_compute_instance.default)
2014/12/09 15:30:00 [DEBUG] google_compute_instance.default: Executing diff
2014/12/09 15:30:00 [DEBUG] google_compute_instance.default: Diff: &terraform.InstanceDiff{Attributes:map[string]_terraform.ResourceAttrDiff{"metadata_fingerprint":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "tags_fingerprint":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "name":_terraform.ResourceAttrDiff{Old:"", New:"test", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "zone":_terraform.ResourceAttrDiff{Old:"", New:"us-central1-a", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "disk.0.image":_terraform.ResourceAttrDiff{Old:"", New:"debian-7-wheezy-v20140814", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "disk.#":_terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "network.0.internal_address":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "network.#":_terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "can_ip_forward":_terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "network.0.name":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "id":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x2}, "metadata.#":_terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "network.0.source":_terraform.ResourceAttrDiff{Old:"", New:"default", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "machine_type":_terraform.ResourceAttrDiff{Old:"", New:"n1-standard-1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "network.0.external_address":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}}, Destroy:false, DestroyTainted:false}
2014/12/09 15:30:00 [INFO] Apply walk starting
2014/12/09 15:30:00 [DEBUG] Creating graph for path: [root]
2014/12/09 15:30:00 [DEBUG] Graph [root] created and valid. 4 nouns.
2014/12/09 15:30:00 [INFO] Configuring provider: google
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] Requesting Google token...
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Email: 1005268309260-dnidkmrpu9kvkvopi3l52sjluq75gimp@developer.gserviceaccount.com
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Scopes: https://www.googleapis.com/auth/compute
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Private Key Length: 916
2014/12/09 15:30:00 terraform-provider-google: 2014/12/09 15:30:00 [INFO] -- Token URL:
2014/12/09 15:30:01 terraform-provider-google: 2014/12/09 15:30:01 [INFO] Instantiating GCE client...
2014/12/09 15:30:01 [DEBUG] google_compute_address.test: expanding to count = 1
2014/12/09 15:30:01 [INFO] Module root walking: google_compute_address.test (Graph node: google_compute_address.test)
2014/12/09 15:30:01 [DEBUG] google_compute_address.test: Executing Apply
2014/12/09 15:30:01 terraform-provider-google: 2014/12/09 15:30:01 [DEBUG] Address insert request: &compute.Address{Address:"", CreationTimestamp:"", Description:"", Id:0x0, Kind:"", Name:"test", Region:"", SelfLink:"", Status:"", Users:[]string(nil)}
google_compute_address.test: Creating...
address: "" => ""
name: "" => "test"
selfLink: "" => ""
2014/12/09 15:30:02 terraform-provider-google: 2014/12/09 15:30:02 [DEBUG] Waiting for state to become: DONE
2014/12/09 15:30:02 terraform-provider-google: 2014/12/09 15:30:02 [TRACE] Waiting 1s before next try
2014/12/09 15:30:03 terraform-provider-google: 2014/12/09 15:30:03 [TRACE] Waiting 1s before next try
2014/12/09 15:30:04 terraform-provider-google: 2014/12/09 15:30:04 [TRACE] Waiting 1s before next try
2014/12/09 15:30:05 terraform-provider-google: 2014/12/09 15:30:05 [TRACE] Waiting 1s before next try
google_compute_address.test: Creation complete
2014/12/09 15:30:07 [DEBUG] google_compute_instance.default: expanding to count = 1
2014/12/09 15:30:07 [INFO] Module root walking: google_compute_instance.default (Graph node: google_compute_instance.default)
2014/12/09 15:30:07 [ERROR] Diffs don't match.
Diff 1: &terraform.InstanceDiff{Attributes:map[string]_terraform.ResourceAttrDiff{"tags_fingerprint":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "name":_terraform.ResourceAttrDiff{Old:"", New:"test", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "zone":_terraform.ResourceAttrDiff{Old:"", New:"us-central1-a", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "disk.0.image":_terraform.ResourceAttrDiff{Old:"", New:"debian-7-wheezy-v20140814", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "metadata_fingerprint":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "disk.#":_terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "network.#":_terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "can_ip_forward":_terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "network.0.name":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "network.0.internal_address":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "network.0.source":_terraform.ResourceAttrDiff{Old:"", New:"default", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "machine_type":_terraform.ResourceAttrDiff{Old:"", New:"n1-standard-1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "network.0.external_address":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "metadata.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}}, Destroy:false, DestroyTainted:false}
Diff 2: &terraform.InstanceDiff{Attributes:map[string]_terraform.ResourceAttrDiff{"network.0.internal_address":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "zone":_terraform.ResourceAttrDiff{Old:"", New:"us-central1-a", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "disk.0.image":_terraform.ResourceAttrDiff{Old:"", New:"debian-7-wheezy-v20140814", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "network.#":_terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "can_ip_forward":_terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "name":_terraform.ResourceAttrDiff{Old:"", New:"test", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "machine_type":_terraform.ResourceAttrDiff{Old:"", New:"n1-standard-1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "tags_fingerprint":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "network.0.external_address":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "metadata.0.foo":_terraform.ResourceAttrDiff{Old:"", New:"107.178.209.128", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "network.0.name":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "metadata.#":_terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "network.0.source":_terraform.ResourceAttrDiff{Old:"", New:"default", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "disk.#":_terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "metadata_fingerprint":_terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}}, Destroy:false, DestroyTainted:false}
2014/12/09 15:30:07 [ERROR] Error walking 'google_compute_instance.default': google_compute_instance.default: diffs didn't match during apply. This is a bug with the resource provider, please report a bug.
2014/12/09 15:30:07 [INFO] Apply walk complete
Error applying plan:
2014/12/09 15:30:07 waiting for all plugin processes to complete...
google_compute_instance.default: diffs didn't match during apply. This is a bug with the resource provider, please report a bug.
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.
2014/12/09 15:30:07 [DEBUG] /home/dcunnin/go-workspace/bin/terraform-provider-google: plugin process exited
The text was updated successfully, but these errors were encountered: