I came here by looking for a solution to weakref.py error. I applied the fixes described below, but the web interface would throw a new error on anything I would do with it (for instance, I tried adding a scheduled job):
Error #0:
OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; omv-mkconf cron 2>&1' with exit code '1': Failed to import the site module
Error processing line 1 of /usr/lib/python3/dist-packages/zope.component-4.3.0-nspkg.pth:
Traceback (most recent call last):
File "/usr/lib/python3.5/site.py", line 173, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/usr/lib/python3.5/types.py", line 166, in <module>
import functools as _functools
File "/usr/lib/python3.5/functools.py", line 23, in <module>
from weakref import WeakKeyDictionary
File "/usr/lib/python3.5/weakref.py", line 109
def remove(wr, selfref=ref(self)), _atomic_removal=_remove_dead_weakref):
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/site.py", line 580, in <module>
main()
File "/usr/lib/python3.5/site.py", line 567, in main
known_paths = addsitepackages(known_paths)
File "/usr/lib/python3.5/site.py", line 344, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.5/site.py", line 212, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.5/site.py", line 183, in addpackage
import traceback
File "/usr/lib/python3.5/traceback.py", line 5, in <module>
import linecache
File "/usr/lib/python3.5/linecache.py", line 8, in <module>
import functools
File "/usr/lib/python3.5/functools.py", line 23, in <module>
from weakref import WeakKeyDictionary
File "/usr/lib/python3.5/weakref.py", line 109
def remove(wr, selfref=ref(self)), _atomic_removal=_remove_dead_weakref):
^
SyntaxError: invalid syntax in /usr/share/php/openmediavault/system/process.inc:175
Stack trace:
#0 /usr/share/openmediavault/engined/module/cron.inc(51): OMV\System\Process->execute()
#1 /usr/share/openmediavault/engined/rpc/config.inc(168): OMVModuleCron->applyConfig()
#2 [internal function]: OMVRpcServiceConfig->applyChanges(Array, Array)
#3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
#4 /usr/share/php/openmediavault/rpc/serviceabstract.inc(149): OMV\Rpc\ServiceAbstract->callMethod('applyChanges', Array, Array)
#5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(565): OMV\Rpc\ServiceAbstract->OMV\Rpc\{closure}('/tmp/bgstatus04...', '/tmp/bgoutputV2...')
#6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(159): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))
#7 /usr/share/openmediavault/engined/rpc/config.inc(213): OMV\Rpc\ServiceAbstract->callMethodBg('applyChanges', Array, Array)
#8 [internal function]: OMVRpcServiceConfig->applyChangesBg(Array, Array)
#9 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
#10 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('applyChangesBg', Array, Array)
#11 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('Config', 'applyChangesBg', Array, Array, 1)
#12 {main}
I reverted weakref.py changes and now the web interface is working normally again.