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 CRASH when private_networking = true after initial droplet creation #67

Closed
petervandenabeele opened this issue Feb 11, 2018 · 3 comments

Comments

@petervandenabeele
Copy link

Detailed stderr log at https://gist.github.com/petervandenabeele/c9949fa4590086b998683b1184095755
Detailed crash log at
https://gist.github.com/petervandenabeele/0e788d498c5170a3281b208ede11fdff

Version:

Terraform v0.11.3
+ provider.digitalocean v0.1.3
  1. plan + apply of a Droplet without private_networking: OK

  2. Added private_networking = true

  3. plan => correct (?)

 ~ digitalocean_droplet.test
      private_networking: "" => "true"
  1. apply => CRASH "panic: interface conversion: interface {} is bool, not string"

See log gist for detailed crash log

  1. On a more general note, can a DigitalOcean Droplet even be converted to private networking after it is created ?
@ghost ghost added bug crash labels Feb 11, 2018
@andrewsomething
Copy link
Member

andrewsomething commented Apr 13, 2018

I am able to reproduce this, and it seems to be true for enabling IPv6 as well.

On a more general note, can a DigitalOcean Droplet even be converted to private networking after it is created ?

Yes, private networking can be enabled on an existing Droplet. It requires a call to /v2/droplets/$DROPLET_ID/actions See: https://developers.digitalocean.com/documentation/v2/#enable-private-networking

Though there are a some important things to note:

@sosedoff
Copy link

Im having the same issue, where terraform apply will crash if i set the private_networking = true. I was able to reproduce the crash multiple times.

Terraform v0.11.7
+ provider.digitalocean v0.1.3

However, after the crash terraform no longer has the droplet resources in its state. So running terraform apply again will actually create a new set of droplets. Here's my example snippet:

provider "digitalocean" {
  token = "${var.token}"
}

resource "digitalocean_ssh_key" "default" {
  name       = "tf_key"
  public_key = "${file("./key.pub")}"
}

resource "digitalocean_droplet" "web" {
  count              = 3
  name               = "web-${count.index}"
  image              = "ubuntu-16-04-x64"
  region             = "nyc3"
  size               = "1gb"
  private_networking = true
}

andrewsomething added a commit that referenced this issue Aug 2, 2018
Don't panic when enabling private_networking or ipv6. (Fixes #67)
@andrewsomething
Copy link
Member

I'm happy to say that yesterday, we release version 1.0.0 of the DigitalOcean Terraform provider. It should include a fix for this issue.

You can find the full changelog here: https://github.com/terraform-providers/terraform-provider-digitalocean/blob/master/CHANGELOG.md#100-september-27-2018

In order to upgrade an existing project to the latest version, run:

terraform init -upgrade

If you believe that this issue is being closed by mistake or the problem has not been resolved, please let me know or feel free to open a new issue with additional details.

Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants