terraform-provider-vultr: Destroy step shows failed status but actually deletes the server

Hi, I was using this to create and destroy Vultr machines, but recently started to get failures on the Destroy step (it says failed but does the job 🀣 server gets deleted, just the exit code is bad and logs an error, below).

My Terraform files did not change, so this might be a bug. I install latest version of the provider always. Here are the logs I get when applying a destroy:

17:49:24 
17:49:24 Initializing the backend...
17:49:25 
17:49:25 Successfully configured the backend "s3"! Terraform will automatically
17:49:25 use this backend unless the backend configuration changes.
17:49:25 
17:49:25 Initializing provider plugins...
17:49:25 
17:49:25 The following providers do not have any version constraints in configuration,
17:49:25 so the latest version was installed.
17:49:25 
17:49:25 To prevent automatic upgrades to new major versions that may contain breaking
17:49:25 changes, it is recommended to add version = "..." constraints to the
17:49:25 corresponding provider blocks in configuration, with the constraint strings
17:49:25 suggested below.
17:49:25 
17:49:25 * provider.vultr: version = "~> 0.1"
17:49:25 
17:49:25 Terraform has been successfully initialized!
17:49:25 
17:49:25 You may now begin working with Terraform. Try running "terraform plan" to see
17:49:25 any changes that are required for your infrastructure. All Terraform commands
17:49:25 should now work.
17:49:25 
17:49:25 If you ever set or change modules or backend configuration for Terraform,
17:49:25 rerun this command to reinitialize your working directory. If you forget, other
17:49:25 commands will detect it and remind you to do so if necessary.
17:49:27 data.vultr_os.ubuntu: Refreshing state...
17:49:27 data.vultr_region.chosen_region: Refreshing state...
17:49:27 data.vultr_ssh_key.ansible: Refreshing state...
17:49:28 vultr_instance.vultr_server: Refreshing state... (ID: 20052301)
17:49:30 vultr_instance.vultr_server: Destroying... (ID: 20052301)
17:49:31 
17:49:31 Error: Error applying plan:
17:49:31 
17:49:31 1 error(s) occurred:
17:49:31 
17:49:31 * vultr_instance.vultr_server (destroy): 1 error(s) occurred:
17:49:31 
17:49:31 * vultr_instance.vultr_server: Error destroying instance (20052301): Unable to destroy server: Server is already pending destruction.
17:49:31 

Hope it helps πŸ˜ƒ in my case for now I just ignore the error status because it fails always, but it works… maybe there was a Vultr api change recently, that drives the plugin crazy πŸ˜ƒ

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

@squat sorry I was afk for the weekend, getting back to work now, will test and report back soon πŸ˜ƒ