Univention Bugzilla – Bug 47586
App Center throws Traceback if interface is configured incorrectly
Last modified: 2021-05-14 16:34:45 CEST
A customer accidentally set a netmask for an interface's network. This resulted in a traceback in the App Center. We debugged it by having a look at the interfaces using UCR: $python >>> from univention.config_registry import interfaces >>> list(interfaces.Interfaces().ipv4_interfaces) [('eth0', {'name': 'eth0', 'ipv6/acceptRA': 'false', 'broadcast': '10.200.14.255', 'start': 'true', 'netmask': '255.255.255.0', 'address': '10.200.14.80', 'type': 'static', 'network': 'netmask=255.255.255.0'})] To reproduce: ucr set interfaces/eth0/network="netmask=255.255.255.0" Open App Center in UMC Request: appcenter/query Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/management/console/base.py", line 253, in execute function.__func__(self, request, *args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 318, in _response result = _multi_response(self, request) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 192, in _response return function(self, request) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 440, in _response return list(function(self, iterator, *nones)) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 286, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/__init__.py", line 207, in query if not self._test_for_docker_service(): File "/usr/lib/pymodules/python2.7/univention/management/console/modules/appcenter/__init__.py", line 236, in _test_for_docker_service if docker_bridge_network_conflict(): File "/usr/lib/pymodules/python2.7/univention/appcenter/utils.py", line 91, in docker_bridge_network_conflict my_net = ipaddr.IPv4Network('%s/%s' % (iface['network'], iface['netmask'])) File "/usr/lib/python2.7/dist-packages/ipaddr.py", line 1336, in __init__ self._ip = self._ip_int_from_string(addr[0]) File "/usr/lib/python2.7/dist-packages/ipaddr.py", line 1098, in _ip_int_from_string raise AddressValueError(ip_str) AddressValueError: netmask 255.255.255.0
So this bug is about the error handling in the appcenter because the following command seems invalid (and possible breaks more than the appcenter): ucr set interfaces/eth0/network="netmask=255.255.255.0"
(In reply to Florian Best from comment #1) > So this bug is about the error handling in the appcenter because the > following command seems invalid (and possible breaks more than the > appcenter): > > ucr set interfaces/eth0/network="netmask=255.255.255.0" Exactly. Once the customer saw the configured interfaces in UCR, they also immediately recognized the mistake and "fixed" it by setting the variable correctly. As you mentioned, I just think the app center shouldn't be broken if one interface is configured correctly. I don't know why the app center checks the interfaces. It might be required regarding the actual installation of apps. If that's so such a traceback should appear if the user tries actually install an app IMO.
This issue has been filed against UCS 4.3. UCS 4.3 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed. If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.