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 crashes with interface conversion in GCE Instance Template #2901

Closed
j-oconnor opened this issue Jul 31, 2015 · 3 comments
Closed

Comments

@j-oconnor
Copy link

Seems to be related to the disk_size_gb arg.

panic: interface conversion: interface is int, not int64
2015/07/31 02:41:57 terraform-provider-google:
2015/07/31 02:41:57 terraform-provider-google: goroutine 38 [running]:
2015/07/31 02:41:57 terraform-provider-google: github.com/hashicorp/terraform/builtin/providers/google.buildDisks(0xc2080522a0, 0x99d3c0, 0xc208040eb0, 0x0, 0x0, 0x0, 0x0, 0x0)

Not sure if I'm expected to create the disk separately then reference it in to the template. The disk_size_gb arg isn't documented, but i saw the code was there and its supported by API.

I'm on 0.6.2dev built from master. I can duplicate readily just using the sample code from docs and adding "disk_size_gb = 20" on the boot disk. I'll post the crash.log if needed.

@j-oconnor
Copy link
Author

I got it to work on my local with simple typecast.

@@ -261,7 +261,7 @@ func buildDisks(d *schema.ResourceData, meta interface{}) ([]*compute.AttachedDi
                                disk.InitializeParams.DiskName = v.(string)
                        }
                        if v, ok := d.GetOk(prefix + ".disk_size_gb"); ok {
-                               disk.InitializeParams.DiskSizeGb = v.(int64)
+                               disk.InitializeParams.DiskSizeGb = int64(v.(int))
                        }
                        disk.InitializeParams.DiskType = "pd-standard"
                        if v, ok := d.GetOk(prefix + ".disk_type"); ok {

@suguru
Copy link
Contributor

suguru commented Jul 31, 2015

I have same issue with disk_size_gb in google_container_cluster.node_config

panic: interface conversion: interface is int, not int64
2015/07/31 17:14:31 terraform-provider-google:
2015/07/31 17:14:31 terraform-provider-google: goroutine 74 [running]:
2015/07/31 17:14:31 terraform-provider-google: github.com/hashicorp/terraform/builtin/providers/google.resourceContainerClusterCreate(0xc208390240, 0x593d00, 0xc2082a7b30, 0x0, 0x0)
2015/07/31 17:14:31 terraform-provider-google:  /private/tmp/terraform20150721-61224-ibcnhu/terraform-0.6.1/src/github.com/hashicorp/terraform/builtin/providers/google/resource_container_cluster.go:256 +0xb6a

djworth pushed a commit to djworth/terraform that referenced this issue Aug 11, 2015
@radeksimko radeksimko added the bug label Aug 13, 2015
catsby added a commit that referenced this issue Aug 19, 2015
* master: (71 commits)
  Updated AWS_SQS_QUEUE docs
  Update CHANGELOG.md
  Update CHANGELOG.md
  Fix #2901
  Update CHANGELOG.md
  Clarify that you get the AMI id from metadata
  provider/aws: Update to aws-sdk 0.9.0 rc1
  use name instead of id  - launch configs use the name and not ID
  Fix typo on heroku_cert example
  google: Code formatted via gofmt
  Code formatted via gofmt
  'terraform output' helptext spacing fixed
  provider/aws: add value into ELB name validation message
  tests: fix missed test update from last merge
  update prevent_destroy error message
  Update CHANGELOG.md
  Update CHANGELOG.md
  providers/aws: Update Launch Config. docs to detail naming and lifecycle recommendation
  release: cleanup after v0.6.3
  v0.6.3
  ...
grubernaut pushed a commit to hashicorp/terraform-provider-google that referenced this issue Jun 6, 2017
@ghost
Copy link

ghost commented May 1, 2020

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 May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants