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

[BUG] - Error: error creating server: gave up after 4 attempts, last error unavailable (resp == nil) #114

Closed
shamblesides opened this issue Feb 12, 2021 · 1 comment
Assignees
Labels

Comments

@shamblesides
Copy link

Describe the bug
I was able to use the terraform provider to create vultr instances a few days ago but now it doesn't seem to work. I get the error in the title consistently.

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

vultr_instance.my_server: Creating...

Error: error creating server: gave up after 4 attempts, last error unavailable (resp == nil)

To Reproduce
I'm not sure how to reproduce it, sorry. It's still happening on my machine.

Desktop (please complete the following information where applicable:

  • OS: Xubuntu 20.04
$ terraform -v
Terraform v0.14.6
+ provider registry.terraform.io/vultr/vultr v2.1.3

Additional context

A few days ago, I did terraform init and set things, up, and was able to successfully run terraform apply, terraform import and terraform destroy to modify my infrastructure.

My config file, vultr.tf: (trying terraform validate returns that it is valid)

terraform {
  required_providers {
    vultr = {
      source = "vultr/vultr"
      version = "2.1.3"
    }
  }
}

provider "vultr" {
  api_key = file("~/.config/vultr-key")
}

resource "vultr_instance" "my_server" {
  region = "atl"
  plan = "vhf-1c-1gb"
  os_id = "391" # fedora-coreos
  hostname = "core1"
  user_data = filebase64("${path.module}/core1.ign")
}
@shamblesides
Copy link
Author

Sorry, this was actually related to my own config, and not even really related to vultr. Specifying the api_key in the vultr provider using ~ won't work. Also I had a newline in my file that had the key in it. Maybe there's better ways to store and specify the API key anyway so I think I'm going to have to learn more about terraform... sorry for the noise!

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

No branches or pull requests

2 participants