Cannot start jail from 11.2-b3 using older release

Status
Not open for further replies.
Joined
Oct 5, 2016
Messages
9
Every time I attempt to start a jail on an older release I get an error stating "Local variable 'addr' referenced before assignment.
jail-error.png

Upon further inspection the error reads:
Code:
Error: concurrent.futures.process._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
	r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 122, in main_worker
	res = loop.run_until_complete(coro)
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
	return future.result()
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 82, in _run
	return await self._call(f'{service_name}.{method}', serviceobj, methodobj, params=args, job=job)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
	return methodobj(*params)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
	return methodobj(*params)
  File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 668, in nf
	return f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 541, in start
	iocage.start()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1628, in start
	callback=self.callback
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_start.py", line 66, in __init__
	self.__start_jail__()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_start.py", line 467, in __start_jail__
	"message": "  + Acquiring DHCP address: FAILED,"
UnboundLocalError: local variable 'addr' referenced before assignment
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 161, in call_method
	result = await self.middleware.call_method(self, message)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1043, in call_method
	return await self._call(message['method'], serviceobj, methodobj, params, app=app, io_thread=False)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 980, in _call
	return await self._call_worker(serviceobj, name, *args)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1007, in _call_worker
	job,
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 938, in run_in_proc
	return await self.run_in_executor(self.__procpool, method, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 923, in run_in_executor
	return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
UnboundLocalError: local variable 'addr' referenced before assignment

I don't know how to translate this or fix it. Can anyone help?
 
D

dlavigne

Guest
Are you starting the jail from the new UI or the legacy UI? If the new UI, do you get the same error from the legacy UI?
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Are you starting the jail from the new UI or the legacy UI? If the new UI, do you get the same error from the legacy UI?
I thought the old UI only did warden jails and the new UI only did iocage jails. Given this, how would they start the same jail from both UIs?
File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1628, in start callback=self.callback
Given this line, we are working with an iocage jail. Do you intend to have the jail set with a static IP or DHCP? Also are you trying to use VIMAGE/vnet? If I had to guess, the jails config.json file is failing to fetch a DHCP address and its just trying to start the jail without one. I don't know enough about jail startup with DHCP to be sure.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Can you provide the output of cat /mnt/iocage/jails/<YOUR JAIL NAME>/config.json?
 

salamander

Cadet
Joined
Feb 4, 2014
Messages
3
Same problem here. In /usr/local/lib/python3.6/site-packages/iocage_lib/ioc_start.py:426 "ifconfig -f" is used to determine the ip addr of the jail, this is not a valid argument in freebsd releases before 11.0 .
If I modify as follows it works:
cmd = ["jexec", f"ioc-{self.uuid}", "ifconfig", interface, "inet"]
Maybe we could check for the release with "if userland_version < 11.0:" and based on this decide for one method...

By the way, the error logging has a problem, since "failed_dhcp" is set by except su.CalledProcessError without defining addr that is used in the error logging later on.

Just realized this was already fixed in the iocage repo for some time....
 
Last edited:
Status
Not open for further replies.
Top