Closed andyshinn closed 6 years ago
Just a shot int the dark...
It looks like CheckNetworkExists
will return false for a non-200 response code or an error: https://github.com/cormacrelf/terraform-provider-zerotier/blob/master/client.go#L185-L197.
According to the Golang http
package at https://golang.org/pkg/net/http/#Client:
A non-2xx status code doesn't cause an error.
Would this mean that a temporary error (such as a 5xx) would cause the provider to think that the network doesn't exist?
We've also learned this happens on a 403 now. In the case a user doesn't have access to the network (the API returns an access_denied
) it tries to create the network. This should likely fail instead (and just let the user know of the permissions issue).
You were right. Latest code fixes it.
I'm having an issue where sometimes the
zerotier_network
resource gets created again (it doesn't think it exists). This particular workspace I didn't catch it and I ended up with two for the same name:I'll try to get state output next time I see this. Unfortunately, I applied this before grabbing state.
Any idea why this might happen?