UnboundLocalError for channels-dvr in FreeNAS

Hi All,

My channels-dvr shows as corrupt in iocage with the following errors. Can someone help resolve?

Error: Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_json.py", line 621, in json_write
ensure_ascii=False)
File "/usr/local/lib/python3.7/contextlib.py", line 119, in exit
next(self.gen)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_common.py", line 594, in open_atomic
os.chmod(filepath, 0o644)
PermissionError: [Errno 1] Operation not permitted: '/mnt/Media/iocage/jails/channels-dvr/config.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_json.py", line 1016, in check_jail_config
self.json_write(conf)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_json.py", line 623, in json_write
raise FileNotFoundError(write_location)
FileNotFoundError: /mnt/Media/iocage/jails/channels-dvr/config.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 130, in call_method
io_thread=False)
File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1077, in _call
return await methodobj(*args)
File "/usr/local/lib/python3.7/site-packages/middlewared/service.py", line 403, in update
f'{self._config.namespace}.update', self, self.do_update, [id, data]
File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1091, in _call
return await run_method(methodobj, *args)
File "/usr/local/lib/python3.7/site-packages/middlewared/utils/run_in_thread.py", line 10, in run_in_thread
return await self.loop.run_in_executor(self.run_in_thread_executor, functools.partial(method, *args, **kwargs))
File "/usr/local/lib/python3.7/site-packages/middlewared/utils/io_thread_pool_executor.py", line 25, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.7/site-packages/middlewared/schema.py", line 965, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/jail.py", line 849, in do_update
iocage.set(p, plugin)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/iocage.py", line 1585, in set
self.get(_prop)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/iocage.py", line 1231, in get
return ioc_json.IOCJson(path).json_get_value(prop)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_json.py", line 1682, in json_get_value
conf, write = self.json_load()
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_json.py", line 1657, in json_load
conf = self.check_config(conf)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_json.py", line 746, in check_config
jail_conf = self.check_jail_config(conf)
File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_json.py", line 1019, in check_jail_config
self.location = f'{self.iocroot}/jails/{tag}'
UnboundLocalError: local variable 'tag' referenced before assignment

This seems like a FreeNAS bug, or file permissions issue on your attached storage perhaps because it is using the wrong filesystem.

What version of FreeNAS are you using? Is this a fresh install?

Upgraded two systems to FreeNAS 11.3 last night. First one is working fine and second one gave me these errors.

Doing a fresh install of FreeNAS now and then going to restore backup