-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Resources not found after update 0.35.0 #287
Comments
Hmm, this is odd. I updated my home network to the latest on the provider and besides an odd upgrade diff that worked itself out with the introduction of the IPv6 attributes, its remaining stable on subsequent plans and showing no diff. I did not get any not found errors either. I wonder if its because you are using more of the IPv6 stuff as I'm just on IPv4 on my network right now. I'm going to see if I can simulate this in the test controller. |
I think I know what the problem is. If I do not set the wan_type_v6 to any value then terraform wants it to set it to For the other two problems I completely deleted the resources und re-added them and that seems to have fixed them. |
I just ran into this issue. I am using version The plan sees the drift:
When I try to apply, I get the not found error:
TF Version:
|
Can you post debug logs? |
Logs posted here - https://gist.github.com/pvicol/26bddc684440573f9a475acf68f0380f |
So what's happening here is that the provider updates the network by hitting
This is unexpected as it should respond with the properties of the network. It only ever responds with |
Looking through the debug logs, the data payload sent by the provider does not include the fields noted in the changed plan. Terraform says these will be changed
However, in the debug log, the payload is missing those fields
From the PUT request method above, the payload is missing the fields being changed. Using Python requests, I discovered that if fields being changed are not added to the payload, the response is empty. After adding the appropriate fields, the response returned is the object/resource changed. Notice after adding (Pdb) network_data = {"_id":"641939a7b17a3e10ccfd10c6","site_id":"default","auto_scale_enabled":False,"dhcpd_boot_enabled":False,"dhcpd_boot_server":"","dhcpd_dns_1":"192.168.40.50","dhcpd_dns_2":"192.168.60.1","dhcpd_dns_3":"192.168.1.1","dhcpd_dns_4":"","dhcpd_dns_enabled":True,"dhcpd_enabled":True,"dhcpd_gateway":"","dhcpd_gateway_enabled":False,"dhcpd_ip_1":"","dhcpd_ip_2":"","dhcpd_ip_3":"","dhcpd_leasetime":86400,"dhcpd_mac_1":"","dhcpd_mac_2":"","dhcpd_mac_3":"","dhcpd_ntp_1":"","dhcpd_ntp_2":"","dhcpd_ntp_enabled":False,"dhcpd_start":"192.168.60.4","dhcpd_stop":"192.168.60.250","dhcpd_time_offset_enabled":False,"dhcpd_unifi_controller":"","dhcpdv6_dns_auto":False,"dhcpdv6_enabled":False,"dhcpd_wins_1":"","dhcpd_wins_2":"","dhcpd_wins_enabled":False,"dhcp_relay_enabled":False,"dhcpguard_enabled":False,"dpi_enabled":False,"dpigroup_id":"","domain_name":"","enabled":True,"exposed_to_site_vpn":False,"gateway_device":"","igmp_fastleave":False,"igmp_querier":"","igmp_snooping":False,"igmp_supression":False,"ipsec_dynamic_routing":False,"ipsec_pfs":False,"ip_subnet":"192.168.60.1/24","ipv6_interface_type":"none","ipv6_pd_prefixid":"","ipv6_ra_enabled":False,"internet_access_enabled":True,"intra_network_access_enabled":True,"is_nat":False,"l2tp_allow_weak_ciphers":False,"lte_lan_enabled":False,"mac_override":"","mac_override_enabled":False,"mdns_enabled":True,"name":"IoT","networkgroup":"LAN","pptpc_require_mppe":False,"purpose":"corporate","radiusprofile_id":"","remote_site_id":"","report_wan_event":False,"require_mschapv2":False,"upnp_lan_enabled":False,"usergroup_id":"","vlan":60,"vlan_enabled":True,"vpn_client_default_route":False,"vpn_client_pull_dns":False,"wan_dns1":"","wan_dns2":"","wan_dns3":"","wan_dns4":"","wan_gateway_v6":"","wan_ipv6":"","wan_provider_capabilities":{},"wan_smartq_enabled":False,"wan_vlan_enabled":False, 'dhcp_v6_lease': 0}
(Pdb) resp = sesh.put(network_url, headers = put_headers, json = network_data)
(Pdb) resp.status_code
200
(Pdb) resp.text
'{"meta":{"rc":"ok"},"data":[]}'
(Pdb) network_data = {"_id":"641939a7b17a3e10ccfd10c6","site_id":"default","auto_scale_enabled":False,"dhcpd_boot_enabled":False,"dhcpd_boot_server":"","dhcpd_dns_1":"192.168.40.50","dhcpd_dns_2":"192.168.60.1","dhcpd_dns_3":"192.168.1.1","dhcpd_dns_4":"","dhcpd_dns_enabled":True,"dhcpd_enabled":True,"dhcpd_gateway":"","dhcpd_gateway_enabled":False,"dhcpd_ip_1":"","dhcpd_ip_2":"","dhcpd_ip_3":"","dhcpd_leasetime":86400,"dhcpd_mac_1":"","dhcpd_mac_2":"","dhcpd_mac_3":"","dhcpd_ntp_1":"","dhcpd_ntp_2":"","dhcpd_ntp_enabled":False,"dhcpd_start":"192.168.60.4","dhcpd_stop":"192.168.60.250","dhcpd_time_offset_enabled":False,"dhcpd_unifi_controller":"","dhcpdv6_dns_auto":False,"dhcpdv6_enabled":False,"dhcpd_wins_1":"","dhcpd_wins_2":"","dhcpd_wins_enabled":False,"dhcp_relay_enabled":False,"dhcpguard_enabled":False,"dpi_enabled":False,"dpigroup_id":"","domain_name":"","enabled":True,"exposed_to_site_vpn":False,"gateway_device":"","igmp_fastleave":False,"igmp_querier":"","igmp_snooping":False,"igmp_supression":False,"ipsec_dynamic_routing":False,"ipsec_pfs":False,"ip_subnet":"192.168.60.1/24","ipv6_interface_type":"none","ipv6_pd_prefixid":"","ipv6_ra_enabled":False,"internet_access_enabled":True,"intra_network_access_enabled":True,"is_nat":False,"l2tp_allow_weak_ciphers":False,"lte_lan_enabled":False,"mac_override":"","mac_override_enabled":False,"mdns_enabled":True,"name":"IoT","networkgroup":"LAN","pptpc_require_mppe":False,"purpose":"corporate","radiusprofile_id":"","remote_site_id":"","report_wan_event":False,"require_mschapv2":False,"upnp_lan_enabled":False,"usergroup_id":"","vlan":60,"vlan_enabled":True,"vpn_client_default_route":False,"vpn_client_pull_dns":False,"wan_dns1":"","wan_dns2":"","wan_dns3":"","wan_dns4":"","wan_gateway_v6":"","wan_ipv6":"","wan_provider_capabilities":{},"wan_smartq_enabled":False,"wan_vlan_enabled":False, 'dhcp_v6_lease': 0, 'ipv6_ra_preferred_lifetime': 0}
(Pdb) resp = sesh.put(network_url, headers = put_headers, json = network_data)
(Pdb) resp.status_code
200
(Pdb) resp.text
'{"meta":{"rc":"ok"},"data":[{"setting_preference":"manual","dhcpdv6_dns_auto":false,"dhcpd_ntp_1":"","vpn_client_default_route":false,"dhcpd_ntp_2":"","dhcpd_gateway_enabled":false,"dhcpd_dns_1":"192.168.40.50","vpn_client_pull_dns":false,"dhcpd_start":"192.168.60.4","dhcpd_unifi_controller":"","ipv6_ra_enabled":false,"dpigroup_id":"","domain_name":"","mac_override":"","ip_subnet":"192.168.60.1/24","dhcpd_dns_4":"","require_mschapv2":false,"ipv6_interface_type":"none","dhcpd_dns_2":"192.168.60.1","dhcpd_dns_3":"192.168.1.1","dhcpd_ip_1":"","dhcpd_ip_2":"","pptpc_require_mppe":false,"dhcpd_ip_3":"","dhcpd_wins_2":"","dhcpd_boot_server":"","wan_dns4":"","is_nat":false,"wan_dns3":"","dhcpd_wins_1":"","wan_dns2":"","dhcpd_dns_enabled":true,"dhcpdv6_enabled":false,"wan_dns1":"","internet_access_enabled":true,"usergroup_id":"","nat_outbound_ip_addresses":[],"dhcp_relay_enabled":false,"radiusprofile_id":"","wan_provider_capabilities":{},"dhcpd_wins_enabled":false,"ipsec_pfs":false,"ipv6_pd_prefixid":"","intra_network_access_enabled":true,"name":"IoT","site_id":"6184407c522ffc043a923ba7","dhcpdv6_leasetime":86400,"_id":"641939a7b17a3e10ccfd10c6","lte_lan_enabled":false,"l2tp_allow_weak_ciphers":false,"dhcpd_leasetime":86400,"purpose":"corporate","igmp_snooping":false,"dhcpd_time_offset_enabled":false,"dhcpguard_enabled":false,"dhcpd_mac_3":"","igmp_supression":false,"dhcpd_mac_2":"","dhcpd_mac_1":"","ipv6_ra_preferred_lifetime":0,"dhcpd_stop":"192.168.60.250","enabled":true,"dhcpd_enabled":true,"vlan":60,"dhcpd_wpad_url":"","igmp_querier":"","networkgroup":"LAN","exposed_to_site_vpn":false,"ipv6_ra_valid_lifetime":86400,"vlan_enabled":true,"remote_site_id":"","mac_override_enabled":false,"igmp_fastleave":false,"gateway_type":"default","dhcpd_gateway":"","ipsec_dynamic_routing":false,"wan_ipv6":"","dhcpd_boot_enabled":false,"wan_smartq_enabled":false,"upnp_lan_enabled":false,"dhcpd_ntp_enabled":false,"wan_vlan_enabled":false,"dpi_enabled":false,"report_wan_event":false,"mdns_enabled":true,"dhcpd_tftp_server":"","auto_scale_enabled":false,"wan_gateway_v6":""}]}' |
New user here. I just set up a new terraform config using this provider (v.0.41.0) Any interaction with the API returns "Not found" as above. |
@paultyng - any insights into this issue? |
There is a related issue in the go-unifi library. I fixed an instance of this issue for the Device resource a while back, and in that case the issue was that the request omitted a field, just like has been observed by @pvicol above for this case. The field you mention ( If anyone wants to do the work to get this fixed, here's the things I had to do last time to do so (with links to the relevant PRs): |
Hi there,
after the update of the last few days I tried to reuse my old plan but suddenly some resources are not found anymore.
I'm not sure, if I'm doing something wrong or if it is the updates but I already removed the resources from the state and reimportetd them again.
Same result.
Hope you can assist to solve that.
Best regards
Moritz Herrmann
The text was updated successfully, but these errors were encountered: