Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Error 400 "Invalid value for ipv6addr" received from Infoblox when updating ipv4 ptr record #66

Open
silviu-iordan opened this issue Aug 9, 2021 · 2 comments

Comments

@silviu-iordan
Copy link

silviu-iordan commented Aug 9, 2021

Great gem, I have tried several features and they are working fine, but I have found one that is not working as expected.
It is the update for a PTR record:

connection = Infoblox::Connection.new(username: 'user', password: 'password1', host: '10.1.1.1', ssl_opts: {verify: false}, timeout: 7)
ptr_record = Infoblox::Ptr.find(connection, {ptrdname:"fqdn_host_name.com", ipv4addr: "10.97.161.5"}).first
=> #<Infoblox::Ptr:0x000055b582cefe40
@_ref="record:ptr/ZG5zLmJpbmRfcHRyJC5fZGVmYXVsdC5hcnBhLmluLWFkZHIuMTAuOTcuMTYxLjUuZGUxYXN3OTg3MDJzLTUubmV0LnZvZGFmb25lLmNvbQ:5.161.97.10.in-addr.arpa/default",
@connection=#<Infoblox::Connection:23480 @host="https://10.1.1.1">,
@disable=false,
@extattrs={},
@ipv4addr="10.97.161.5",
@ipv6addr="",
@name="5.161.97.10.in-addr.arpa",
@ptrdname="fqdn_host_name.com",
@view="default",
@zone="161.97.10.in-addr.arpa">

ptr_record.ipv4addr = "10.97.161.6"

Error received:

pry(main)> ptr_record.put
Infoblox::Error: Error: 400 { "Error": "AdmConProtoError: Invalid value for ipv6addr: "": Invalid IPv6 address",
"code": "Client.Ibap.Proto",
"text": "Invalid value for ipv6addr: "": Invalid IPv6 address"
}

I do not understand why is showing error "Invalid value for ipv6addr" when I am actually updating an ipv4 address.

@silviu-iordan
Copy link
Author

@unclebilly
I have verified the issues opened and I have found a similar one, issue #43, but with Infoblox::Ptr.find
The WAPI version that we are using is 2.0:
[1] pry(main)> Infoblox.wapi_version
=> "2.0"

May you please have a look at this issue also, maybe offer a workaround.

@silviu-iordan
Copy link
Author

There is a workaround:

  • after adding "ptr_record.ipv6addr = nil" it is working fine
  • inside the gem if an attribute is assigned a value of "nil" then it is no sent to the Infoblox
  • Infoblox eas returning that error because I was trying to send @ipv6addr="" and this is not a valid IPv6 address value

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant