Forris error 500, high CPU utilization

This topic was supposed to be a cry for help, but as I was collecting more details I managed to solve the problem. I’ll post it anyway in hope that it will help somebody in the future.


I’ve noticed high CPU utilization caused by foris processes.

They live like a rock stars - their life is short but intense. Every time a new one starts, there is an error in lighttpd log:

2018-01-07 15:38:44: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-wizard.socket-0 
2018-01-07 15:38:45: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-config.socket-0 
2018-01-07 15:38:47: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-wizard.socket-0 
2018-01-07 15:38:49: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-config.socket-0 
2018-01-07 15:38:50: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-wizard.socket-0 
2018-01-07 15:38:53: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-config.socket-0 
2018-01-07 15:38:54: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-wizard.socket-0 
2018-01-07 15:38:55: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-config.socket-0 
2018-01-07 15:38:59: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-config.socket-0 
2018-01-07 15:38:59: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-wizard.socket-0 
2018-01-07 15:39:03: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-config.socket-0 
2018-01-07 15:39:03: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-wizard.socket-0 
2018-01-07 15:39:05: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-config.socket-0 
2018-01-07 15:39:05: (mod_fastcgi.c.3574) child exited: 1 unix:/tmp/fastcgi.foris-wizard.socket-0 

Foris webui gives me an error 500. Luci works fine.
It’s hard to tell when the problem started since I’ve not used foris for a long time.

I’ve digged through the lighttpd config files. forris-wizzard.conf just executes a script:

# lighttpd include file for Foris - it just calls the script
# that generates lighttpd config from UCI settings
include_shell "sh /usr/share/foris/lighttpd-dynamic-conf wizard"

Let’s try to execute it from shell:

[root@turris conf.d]# /usr/share/foris/lighttpd-dynamic-conf wizard
ERROR:foris.plugins:Unable to import package 'openvpn'.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/foris/plugins/__init__.py", line 102, in _get_plugin_classes
    package = import_module("%s" % package_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/foris/plugins/openvpn/__init__.py", line 12, in <module>
    from foris.core import gettext_dummy as gettext, ugettext as _
ImportError: No module named core
Traceback (most recent call last):
  File "/usr/bin/foris", line 4, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/foris/__main__.py", line 59, in main
    main_app = app_map[args.app](args)
  File "/usr/lib/python2.7/site-packages/foris/wizard_app.py", line 50, in prepare_wizard_app
    return prepare_common_app(args, "wizard", init_app_wizard, top_index, logger)
  File "/usr/lib/python2.7/site-packages/foris/common_app.py", line 96, in prepare_common_app
    loader.autoload_plugins()
  File "/usr/lib/python2.7/site-packages/foris/plugins/__init__.py", line 76, in autoload_plugins
    plugin_classes += self._get_plugin_classes(subdir_name)
TypeError: 'NoneType' object is not iterable
var.foris-wizard.bin = "/usr/bin/foris"
var.foris-wizard.cgi = "/usr/share/foris/foris-wizard-cgi"
var.foris-wizard.scriptname = "/foris/wizard"
var.foris-wizard.flags = " -s flup -a wizard"
var.foris-wizard.paths = "|AAAAAA|amespace(app='wizard',|ackend='ubus',|ackend_socket='/var/run/ubus.sock',|ebug=False,|ost='0.0.0.0',|oauth=False,|ucipath=None,|ort=8080,|outes=True,|erver='flup',|ession_timeout=900,|tatic=False)|izard|function|nit_app|t|x1f0b280>|function|op_index|t|x1f16de0>|logging.Logger|bject|t|x199e940>"

$HTTP["url"] =~ "^" + var.foris-wizard.scriptname + "/(" + var.foris-wizard.paths + ")$" {
	fastcgi.debug = 0
	fastcgi.server = (
		var.foris-wizard.scriptname => (
			"python-fcgi" => (
				"socket" => "/tmp/fastcgi.foris-wizard.socket",
				"bin-path" => var.foris-wizard.bin + var.foris-wizard.flags,
				"check-local" => "disable",
				"max-procs" => 1,
			)
		)
	)
}
alias.url += ( var.foris-wizard.scriptname + "/static/plugins/diagnostics/" => "/usr/share/foris/plugins/diagnostics/static/" )
alias.url += ( var.foris-wizard.scriptname + "/static/plugins/openvpn/" => "/usr/share/foris/plugins/openvpn/static/" )
alias.url += ( var.foris-wizard.scriptname + "/static/" => "/usr/lib/python2.7/site-packages/foris/static/" )
[root@turris conf.d]#

Let’s install foris-openvpn-plugin package and see what happens…
There is now an new openssl process generating the dhparams, which can take a long time. However, no new cpu hogging foris processes, so why not check out the webgui:

Success! It’s working.

1 Like

Same issue, after reboot it’s OK for few (3-7) days.

same issue here just send an email to the support email.