Trying to add a host with an invalid IPv6 address causes an internal server error message to be returned instead of the appropriate message from the server.
Stack trace is below.
[Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] Traceback (most recent call last): [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/share/ipa/wsgi.py", line 48, in application [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] return api.Backend.session(environ, start_response) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 142, in call [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] return self.route(environ, start_response) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 154, in route [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] return app(environ, start_response) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 249, in call [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] response = self.wsgi_execute(environ) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 220, in wsgi_execute [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] result = self.Commandname [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 412, in call [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] default = self.get_default(params) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 666, in get_default [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] return dict(self.__get_default_iter(kw)) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 676, in __get_default_iter [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] default = param.get_default(kw) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipalib/parameters.py", line 873, in get_default [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] default = self._get_default(*kw) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipalib/parameters.py", line 228, in call [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] return self.callback(vals) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipalib/plugins/dns.py", line 311, in <lambda> [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] default_from=lambda name_from_ip: _reverse_zone_name(name_from_ip), [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/ipalib/plugins/dns.py", line 150, in _reverse_zone_name [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] net = netaddr.IPNetwork(netstr) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] File "/usr/lib/python2.7/site-packages/netaddr/ip/init.py", line 926, in init [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] raise AddrFormatError('invalid IPNetwork %s' % addr) [Fri Aug 12 13:16:19 2011] [error] [client 10.11.8.88] AddrFormatError: invalid IPNetwork feed:ada1:216:3eff:fe2d:6642/64
How to reproduce:
install IPA with --setup-dns
do any of these to get an internal error: a. ipa dnszone-add --name-from-ip=feed:ada1:216:3eff:fe2d:6642/64 b. ipa dnszone-find --name-from-ip=feed:ada1:216:3eff:fe2d:6642/64 c. In the UI, try to add new reverse zone for IP feed:ada1:216:3eff:fe2d:6642/64
I get the same thing with and without your patch:
# ipa dnszone-add --name-from-ip=feed:ada1:216:3eff:fe2d:6642/64 ipa: ERROR: invalid 'name_from_ip': invalid format
Not getting an internal error.
I've been able to reproduce this but I think the patch needs more documentation.
I think that this breaks ipa user-find <nothing> too.
New patch is on the list. See http://www.redhat.com/archives/freeipa-devel/2011-September/msg00370.html for more info.
Fixed in:
ipa-2-1: 63182c9
Master branch shall be solved in a more complex way - see ticket #1847.
Please push the fix to master as well, as the base problem exists there. For backwards compativbility, we need the current API to work correctly, so the fix for 1847 is irrelevant to fixing this.
master: 48a67d9
Metadata Update from @admiyo: - Issue assigned to jcholast - Issue set to the milestone: FreeIPA 2.1.2 (bug fixing)
Login to comment on this ticket.