AttributeError("'ForisState' object has no attribute 'password_set'",)

Without doing any changes, when I tried to login to the web gui I got the following screen :frowning:

A reboot fixed the issue, but still really confusing:

Stack trace
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/foris/middleware/backend_data.py", line 54, in __call__
    data = current_state.backend.perform("web", "get_data")
  File "/usr/lib/python3.6/site-packages/foris/backend.py", line 74, in perform
    raise e
  File "/usr/lib/python3.6/site-packages/foris/backend.py", line 61, in perform
    response = self._instance.send(module, action, data)
  File "/usr/lib/python3.6/site-packages/foris_client/buses/ubus.py", line 104, in send
    "final": True, "multipart": False, "request_id": request_id
RuntimeError: Object 'foris-controller-web' was not found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/foris/middleware/reporting.py", line 93, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python3.6/site-packages/foris/middleware/backend_data.py", line 60, in __call__
    return self.app(environ, start_response)
  File "/usr/lib/python3.6/site-packages/bottle_i18n.py", line 68, in __call__
    return self.app(e,h)
  File "/usr/lib/python3.6/site-packages/bottle.py", line 979, in __call__
    return self.wsgi(environ, start_response)
  File "/usr/lib/python3.6/site-packages/bottle.py", line 954, in wsgi
    out = self._cast(self._handle(environ))
  File "/usr/lib/python3.6/site-packages/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/lib/python3.6/site-packages/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/usr/lib/python3.6/site-packages/bottle.py", line 3639, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/foris/config/__init__.py", line 870, in top_index
    if not current_state.password_set:  # auto login if no password is set
AttributeError: 'ForisState' object has no attribute 'password_set'


Environment
{'CONTENT_LENGTH': '0',
 'DOCUMENT_ROOT': '/www',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTPS': 'on',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
 'HTTP_ACCEPT_LANGUAGE': 'en-GB,en-US;q=0.9,en;q=0.8,sv;q=0.7,fr;q=0.6',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'foris.session=SESSION_COOKIE; '
                'foris.ws.session=SESSION',
 'HTTP_HOST': '172.16.200.1',
 'HTTP_REFERER': 'https://LOCAL_IP/',
 'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) '
                    'AppleWebKit/537.36 (KHTML, like Gecko) '
                    'Chrome/71.0.3578.98 Safari/537.36',
 'PATH_INFO': '/',
 'PATH_TRANSLATED': '/www/',
 'QUERY_STRING': '',
 'REDIRECT_STATUS': '200',
 'REMOTE_ADDR': 'SOURCE_IP',
 'REMOTE_PORT': '62997',
 'REQUEST_METHOD': 'GET',
 'REQUEST_SCHEME': 'https',
 'REQUEST_URI': '/foris/config/',
 'SCRIPT_FILENAME': '/www/foris/config',
 'SCRIPT_NAME': '/foris/config',
 'SERVER_ADDR': 'LOCAL_IP',
 'SERVER_NAME': 'LOCAL_IP',
 'SERVER_PORT': '443',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'lighttpd/1.4.50',
 'SSL_CIPHER': 'ECDHE-RSA-AES128-GCM-SHA256',
 'SSL_CIPHER_ALGKEYSIZE': '128',
 'SSL_CIPHER_USEKEYSIZE': '128',
 'SSL_PROTOCOL': 'TLSv1.2',
 'bottle.app': <bottle.Bottle object at 0xc95450>,
 'bottle.get': <bottle.FormsDict object at 0x111b320>,
 'bottle.raw_path': '/',
 'bottle.request': <LocalRequest: GET https://172.16.200.1/foris/config/>,
 'bottle.request.query': <bottle.FormsDict object at 0x111b320>,
 'bottle.request.urlparts': SplitResult(scheme='https', netloc='172.16.200.1', path='/foris/config/', query='', fragment=''),
 'bottle.route': <GET '/' {'template_adapter': <class 'bottle.Jinja2Template'>}>,
 'foris.backend': UbusSender('/var/run/ubus.sock'),
 'foris.language': 'en',
 'foris.session': <foris.middleware.sessions.SessionForisProxy object at 0x10b6930>,
 'foris.session.data': {'_messages': [],
                        'csrf_token': 'TOKEN'},
 'foris.session.id': '00000000000000000000000000000000',
 'foris.version': '98.17',
 'route.handle': <GET '/' {'template_adapter': <class 'bottle.Jinja2Template'>}>,
 'route.url_args': {},
 'wsgi.errors': <flup.server.fcgi_base.OutputStream object at 0x10bde90>,
 'wsgi.input': <flup.server.fcgi_base.InputStream object at 0x10963e0>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'https',
 'wsgi.version': (1, 0)}

I have same troubles with Turris OS 4.0.

Same problem, Turris 1.1, OS 3.11.2.
It just worked when booted from internal memory, but when booting from SD card brings this error in Foris.
(Reverted from SD to internal memory to resolve a problem with RAM and using commands from this post: "Cannot allocate memory" - Only 250MB of RAM...?!)

Edit: Problem solved, my fault: due to the limited size of RAM, Foris used to fail, leaving processes in memory - so I disabled foris-controller package. After re-enabling it, Foris works fine now.