[SOLVED] Foris - keeps showing wizard

Hello there,
I have already configured my new Omnia via wizard couple of days ago (successfully), but 2 days back (I guess once I updated to latest version using updater.sh) cause that “wizard” is now default page of my web server again.
I would like to avoid running whole wizard again as I’ve already done some config changes, anyway:

What I have tried:

  1. I entered new password and tried to skip wizard => got “Creating whole configs is not possible, you have to live with what there is already”
  2. I can access /config, but it’s not 100% working, it’s somehow broken :confused:
  3. I tried to delete whole config => it is same

But configuration seems to be fine:

config config 'settings'
        option lang 'en'

config config 'auth'
        option password '$REAL HASH REMOVED'

config config 'wizard'
        option allowed_step_max '10'
        option finished '1'

config config 'eula'
        option agreed_updater '1'

I could eventually disable foris at all - because I am mostly managing stuff via ssh.
But it would be nice to have it working … any hints?

Permission seems to be fine on /etc/config
-rw-r--r-- 1 root root 320 Nov 9 13:50 foris

Any hints? I would be completely fine, just get rid of this wizard, but I don’t want to modify foris scripts as they are replaced by updater.

Can you post a listing of the whole/etc/config directory? The config you have posted looks fine but if you keep receiving the error message about creating configs, there must be something else that’s missing.

Sure. I think permissions are all right. There is plenty of free space.
Everything seems to be fine.

drwxr-xr-x    1 root     root           656 Nov  9 14:45 .
drwxr-xr-x    1 root     root          1664 Nov  9 21:05 ..
-rw-r--r--    1 root     root          1038 Sep  5 15:19 ahcpd
-rw-r--r--    1 root     root           777 Sep  5 16:17 ddns
-rw-r--r--    1 root     root           907 Nov  1 19:03 dhcp
drwxr-xr-x    1 root     root           160 Nov  7 21:35 dnskeys
-rw-r--r--    1 root     root           861 Sep  5 13:01 etherwake
-rw-r--r--    1 root     root            64 Oct 30 19:08 firewall
-rw-r--r--    1 root     root           320 Nov  9 13:50 foris
-rw-r--r--    1 root     root           262 Nov  7 21:50 foris-old
-rw-r--r--    1 root     root             0 Nov  1 19:10 foris-opkg
-rw-r--r--    1 root     root           266 Sep  5 15:34 fstab
-rw-r--r--    1 root     root           129 Sep  5 13:32 hd-idle
drwxr-xr-x    1 root     root            22 Oct 30 19:52 iptables
-rw-r--r--    1 root     root          1061 Oct 25 21:11 luci
-rw-rw-r--    1 root     root          3475 Sep  5 12:29 luci_statistics
-rw-r--r--    1 root     root            78 Sep  5 15:44 lxc
-rw-------    1 root     root           104 Oct 27 16:24 lxc-auto
-rw-r--r--    1 root     root           595 Sep  5 15:35 minidlna
-rw-rw-r--    1 root     root           321 Sep  5 12:29 mjpg-streamer
-rw-r--r--    1 root     root            68 Sep  5 15:17 mountd
-rw-r--r--    1 root     root           936 Nov  7 21:14 network
-rw-r--r--    1 root     root           449 Sep  5 13:34 ntpclient
-rw-r--r--    1 root     root         13054 Sep  5 14:45 openvpn
drwxr-xr-x    1 root     root            26 Oct 30 19:49 orig
-rw-r--r--    1 root     root           190 Sep  5 15:16 pptpd
-rw-r--r--    1 root     root           693 Sep  5 13:24 rainbow
-rw-r--r--    1 root     root          1480 Sep  5 13:23 resolver
-rw-r--r--    1 root     root            97 Sep  5 15:19 rpcd
-rw-r--r--    1 root     root           129 Sep  5 13:47 samba
-rw-r--r--    1 root     root           141 Sep  5 14:39 schnapps
-rw-r--r--    1 root     root           203 Sep  5 14:39 socat
-rw-r--r--    1 root     root          6281 Oct 30 18:47 sshd
-rw-------    1 root     root           819 Nov  9 14:45 sslh
-rw-r--r--    1 root     root          1147 Nov  7 21:26 system
-rw-r--r--    1 root     root          6807 Sep  5 13:02 tinyproxy
-rw-r--r--    1 root     root          2335 Sep  5 14:41 transmission
-rw-------    1 root     root           322 Oct 27 16:40 tvheadend
-rw-r--r--    1 root     root             0 Sep  5 15:34 ubootenv
-rw-r--r--    1 root     root          1147 Sep  5 15:34 ucitrack
-rw-r--r--    1 root     root            41 Oct 25 20:43 ucollect
-rw-r--r--    1 root     root           255 Nov  9 12:20 updater
-rw-------    1 root     root           179 Nov  1 18:52 updater-opkg
-rw-r--r--    1 root     root           700 Sep  5 14:49 upnpd
-rw-r--r--    1 root     root           689 Sep  5 15:12 user_notify
-rw-r--r--    1 root     root           863 Nov  7 21:26 wireless
-rw-r--r--    1 root     root            61 Sep  5 13:25 wol
-rw-r--r--    1 root     root           101 Sep  5 14:49 wshaper


Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mmcblk0p1         7633920    162500   7470400   2% /
tmpfs                  1035500      2420   1033080   0% /tmp
tmpfs                      512         4       508   1% /dev

And here is log produced once I set password in wizard and press “Skip”

2016-11-10 09:41:48: (log.c.194) server started
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr: Traceback (most recent call last):
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/utils/reporting_middleware.py", line 86, in __call__
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return self.app(environ, start_response)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle_i18n.py", line 68, in __call__
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return self.app(e,h)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle.py", line 979, in __call__
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return self.wsgi(environ, start_response)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle.py", line 954, in wsgi
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     out = self._cast(self._handle(environ))
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle.py", line 862, in _handle
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return route.call(**args)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle.py", line 682, in mountpoint_wrapper
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     body = app(request.environ, start_response)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle.py", line 979, in __call__
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return self.wsgi(environ, start_response)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle.py", line 954, in wsgi
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     out = self._cast(self._handle(environ))
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle.py", line 862, in _handle
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return route.call(**args)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/bottle.py", line 1729, in wrapper
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     rv = callback(*a, **ka)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/utils/bottle_csrf.py", line 85, in wrapper
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return callback(*args, **kwargs)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/utils/__init__.py", line 64, in wrapper
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return func(*args, **kwargs)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/wizard.py", line 535, in step_post
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     if wiz.save():
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/wizard.py", line 134, in save
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return sup.save(extra_callbacks=extra_callbacks)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/config_handlers/base.py", line 66, in save
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     form.save()
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/fapi.py", line 239, in save
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     commit()
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/nuci/configurator.py", line 45, in commit
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     client.edit_config_multiple([cu.get_xml() for cu in config_updates])
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/nuci/client.py", line 357, in edit_config_multiple
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     netconf.edit_config("running", config=config_root)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/ncclient/manager.py", line 89, in wrapper
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return self.execute(op_cls, *args, **kwds)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/foris/nuci/client.py", line 94, in execute
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     raise_mode=cls._raise_mode).request(*args, **kwargs)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/ncclient/operations/edit.py", line 58, in request
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     return self._request(node)
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:   File "/usr/lib/python2.7/site-packages/ncclient/operations/rpc.py", line 289, in _request
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr:     raise self._reply.error
2016-11-10 09:42:30: (mod_fastcgi.c.2527) FastCGI-stderr: RPCError: Creating whole configs is not possible, you have to live with what there is already

Ok, so I was able to solve my issue.

The whole problem is that Foris has a problem if there is any directory under /etc/config/, even a symbolic link to directory is a problem and causing Foris not to read configuration correctly - I did not check its python scripts so much, but I guess it reads directory and once hit anything else than file it gets confused.

2 Likes

I can’t seem to be able to reproduce this. I even created directories with the same names as you did. It still works like expected.

BTW, if you wanted to read the code, you’d want to read nuci, not foris.

There are files inside directories - problem is dnskeys (I just check that for you) directory - which is eventually read before foris file because of alphabetical order. And this directory contains dns keys (pair key and private - which I cannot post for obvious reason) for DDNS update on my bind server and shell script responsible for invoking nsupdate, which is:

#cat updateDNS.sh
#!/bin/bash
IP=`ip addr show dev eth1 |awk '/inet /{print substr($2,0)}' | awk -F'/' '{print $1 }'`

nsupdate -D -k /etc/dnskeys/Kxxx.\+123\+12345.key << EOF
server ns.mydomain.me
zone mydomain.me
update delete xxx.mydomain.me
update delete cbc.mydomain.me
update add xxx.mydomain.me 86400 A ${IP}
update add cbc.mydomain.me 86400 CNAME xxx.mydomain.me
send
quit
EOF

Also once you done that, open router address in anonymous window - it may be cached.

I had the same (or very similar) problem right now.
I deleted my subdirectory (with backup of sshd configuration), and foris works again…

Thank you, @Joe !

I see. Obviously, xyz wasn’t a good name for the test directory.

I did manage to reproduce it. Considering the fact that even uci show stops at the first directory it finds, I think it is safe to assume the problem is not in foris or nuci.

I’ll consider looking into the uci library. However, I think you should not put random directories in /etc/config, as it is where the uci configuration lives.

Found and fixed it. It’ll appear in the next release.

Yeah, I know, I moved them to /etc/ instead :slight_smile:
But thanks for fix!