-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
unifi_network invalid payload #196
Comments
Adding some more context. I am running this against version 6.4.54 And here is a terraform snippet that can reproduce the error: resource "unifi_site" "customer" {
description = "to_delete"
}
resource "unifi_network" "management" {
site = unifi_site.customer.name
name = "management"
purpose = "vlan-only"
vlan_id = 101
} Adding in a dummy value for resource "unifi_network" "management" {
site = unifi_site.customer.name
name = "management"
purpose = "vlan-only"
vlan_id = 101
wan_gateway = "0.0.0.0"
lifecycle {
ignore_changes = [
wan_gateway,
]
}
} |
Can confirm getting same POST Message (400) on apply.....using provider = 0.34.0 and unifi os 1.11.0-16 (EA) for UDM Pro...can provide screenshots logs if needed...thanks |
I added a test for this, but I suspect I need to upgrade the unifi version that it's run against: https://github.com/paultyng/terraform-provider-unifi/pull/197/checks?check_run_id=3887403832 |
Hmm, the tests should already be running against the latest versions |
Good stuff....still super new to terraform, today was the first day I could actually even get any response, I am a software dev, but very green....Thank you guys for your work!!! |
I think this is the same issue as #107, but I may not be able to investigate further for another few weeks. In the mean time, if anyone can produce a reproduction case (ideally an acceptance test in the repo), that should help a lot. |
I'm running into the same issue at present, however the workaround mentioned above doesn't always work. adding lifecycle {
ignore_changes = [
wan_gateway,
]
} still results in a 400 InvalidPayload error when a change to the network needs to be applied removing this and having just a dummy "wan_gateway" results in a successful run when another change is needing to be applied (ie IP Range change), but without the lifecycle block it results in wanting to apply the wan_gateway on every run but results in a very misleading "Not Found" error. All API calls return 200 so not sure where that particular error is coming from. Also on 6.4.54 (Cloud Key) resource "unifi_network" "Main" {
dhcp_dns = ["172.16.12.102"]
dhcp_enabled = true
dhcp_lease = "3600"
dhcp_start = "172.16.10.6"
dhcp_stop = "172.16.10.254"
name = "Main"
purpose = "corporate"
site = var.site
subnet = "172.16.10.1/24"
vlan_id = 10
wan_gateway = "0.0.0.0"
lifecycle {
ignore_changes = [
wan_gateway,
]
}
} |
I have the same issue... Any changes to a network, be it a dhcp scope or a name or other parameter results in:
network.tf:
network-variables.tf:
network.auto.tfvars:
|
Did some more investigation here, most of these are already My guess though is this has to do with how certain fields are only roundtripped if the |
I'm encountering this specific issue as well, in the same way that @kurtmc reports. |
Recently I have noticed that we are getting the following error quite a lot:
I turned on trace to see if unifi gives me a better error:
Should we make
wan_gateway
a string pointer so that it's not marshalled to an empty string when this request is made?The text was updated successfully, but these errors were encountered: