vultr / terraform-provider-vultr

Terraform Vultr provider
https://www.terraform.io/docs/providers/vultr/
Mozilla Public License 2.0
189 stars 65 forks source link

[BUG] - new instance creation fails with {"error":"instance not found","status":404} #462

Closed new23d closed 5 months ago

new23d commented 5 months ago

Use of the vultr_instance resource fails within seconds with {"error":"instance not found","status":404}.

This wasn't happening until 2 months ago I believe. But when I fired up Terraform today, it could not create new instances any more.

I noticed that in the Vultr Web UI, visiting https://my.vultr.com/subs/?id=45739174-f1ec-46a5-ae4d-038e45e5bc27 (with the UUID copied from the failure output shown below) would complain along the lines of subscription not active yet.

Expected behavior

Should be more tolerant to the 404 being returned from Vultr's API when a new instance is created. Maybe the upstream API has changed its behaviour (for the worse.)

Failure Output

vultr_instance.httpd["lhr"]: Creating...
vultr_instance.httpd["lhr"]: Still creating... [10s elapsed]
╷
│ Error: error while waiting for Server 45739174-f1ec-46a5-ae4d-038e45e5bc27 to be completed: error retrieving Server45739174-f1ec-46a5-ae4d-038e45e5bc27 : {"error":"instance not found","status":404}

Versions Terraform: 1.5.7 Provider: 2.19.0 and master branch

FWIW, I was able to get around by upping the Delay here to 60 seconds and running a local version of the provider. I took the cue from the web UI which in about ~45 seconds would show a legit page for a given instance UUID.

optik-aper commented 5 months ago

@new23d There was a bug in the API which should have been fixed. Does this still happen to you?

new23d commented 5 months ago

@optik-aper this was happening to me earlier today. Has the bug been fixed in the last 4-5 hours?

optik-aper commented 5 months ago

@new23d Yeah, about 2 hours ago.

new23d commented 5 months ago

Right, I see. Good ol' luck of mine strikes again. I'll close the issue.

optik-aper commented 5 months ago

I'm glad you noticed it and brought it up any way about it. Thanks for the help.

new23d commented 5 months ago

Is there a place to monitor for API issues at Vultr? I had checked https://status.vultr.com/ and there was nothing related to this.

optik-aper commented 5 months ago

Yeah, that would be the place. This one was spotted first thing in the AM and resolved within an hour so I don't think a global notification was created this time, but that's where it would go.