Foris WAN tab - error when DNS list used in config

Description of problem:
When a user manually configures the /etc/config/network to use multiple DNS, the Foris tab for WAN won’t load up. Error is raised instead. The config mode (static, auto DHCP, etc.) does not matter. Failing in any case.

Release number:
Turris OS 3.6.1

How reproducible:
always

Steps to Reproduce:

  1. edit the network config
    # vim /etc/config/network
    add lines to any interface with DHCP proto and save, e.g.:
        list dns '216.31.204.130'
        list dns '193.29.206.206'
  1. Open Foris interface, click WAN tab

Actual results:
Error with this traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/foris/utils/reporting_middleware.py", line 86, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python2.7/site-packages/bottle_i18n.py", line 68, in __call__
    return self.app(e,h)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 979, in __call__
    return self.wsgi(environ, start_response)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 954, in wsgi
    out = self._cast(self._handle(environ))
  File "/usr/lib/python2.7/site-packages/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 682, in mountpoint_wrapper
    body = app(request.environ, start_response)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 979, in __call__
    return self.wsgi(environ, start_response)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 954, in wsgi
    out = self._cast(self._handle(environ))
  File "/usr/lib/python2.7/site-packages/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python2.7/site-packages/foris/utils/__init__.py", line 65, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/foris/config.py", line 478, in config_page_get
    return config_page.render(active_config_page_key=page_name)
  File "/usr/lib/python2.7/site-packages/foris/config.py", line 111, in render
    return super(WanConfigPage, self).render(**kwargs)
  File "/usr/lib/python2.7/site-packages/foris/config.py", line 75, in render
    return self.default_template(form=form, title=title, description=description, **kwargs)
  File "/usr/lib/python2.7/site-packages/foris/config.py", line 61, in default_template
    **kwargs)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 3615, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 3405, in render
    self.execute(stdout, env)
  File "/usr/lib/python2.7/site-packages/bottle.py", line 3392, in execute
    eval(self.co, env)
  File "/usr/lib/python2.7/site-packages/foris/templates/config/main.tpl", line 26, in <module>
    %for field in form.active_fields:
  File "/usr/lib/python2.7/site-packages/foris/fapi.py", line 226, in active_fields
    return self.get_active_fields()
  File "/usr/lib/python2.7/site-packages/foris/fapi.py", line 190, in get_active_fields
    data = data or self.data
  File "/usr/lib/python2.7/site-packages/foris/fapi.py", line 115, in data
    self.__data_cache = self.current_data
  File "/usr/lib/python2.7/site-packages/foris/fapi.py", line 126, in current_data
    self._update_nuci_data()
  File "/usr/lib/python2.7/site-packages/foris/fapi.py", line 201, in _update_nuci_data
    preprocessed = field.nuci_preproc(value)
  File "/usr/lib/python2.7/site-packages/foris/config_handlers/base.py", line 973, in <lambda>
    nuci_preproc=lambda val: extract_dns_item(val.value, 0),
AttributeError: 'List' object has no attribute 'value'

Expected results:
Displayed Foris page (showing at least that the config was modified manually, so the fields Foris is pulling from the config might not me complete etc.). At least show Foris navigation. It’s pretty annoying when accidentally clicked.

It’s definitely should not be a priority issue. I’m just being annoying, nit picking and sharing feedback. :wink:

For reference upstream ticket https://gitlab.labs.nic.cz/turris/foris/issues/43 Thanks for reporting this issue.

1 Like