lord-kyron/terraform-provider-phpipam

JSON parsing error: json: cannot unmarshal bool into Go struct field Address.excludePing of type string

Closed this issue · 1 comments

Hi,
Since updating phpipam to version 1.6.0, we have problems creating IPs in phpipam with the "phpipam_address" resource
I get this error :

Error: JSON parsing error: json: cannot unmarshal bool into Go struct field Address.excludePing of type string - Response data: {"id":"115399","subnetId":"11643","ip":"","is_gateway":"0","description":"VM pour DNS Forwarder","hostname":"**","mac":null,"owner":"DITC","tag":"2","deviceId":null,"location":null,"port":null,"note":null,"lastSeen":null,"excludePing":"\u0000","PTRignore":"\u0000","PTR":"0","firewallAddressObject":null,"editDate":"2024-05-28 16:22:54","customer_id":null}

I use version 1.6.2 of the phpipam provider

Thanks

I think the problem is not in the terraform provider but in the database phpipam conversion script when installing version 1.6.0. In tinyint type fields, instead of having the value 0, there is now the value \u0000 which causes a problem for the terraform requests. The solution is to delete the entry in phpipam and recreate the entry with terraform (terraform put the value 0 back into fields) or simply make a modification to the entry in phpipam to reset the value to 0 in the tinyint type fields.