Cannot destroy iocage jail

Status
Not open for further replies.

itsryan

Dabbler
Joined
Jan 11, 2017
Messages
20
Hello All,

I have been messing around with iocage and I was able to get a new jail created no problem but now that in trying to destroy the jail I run into a error.

Keep in mind that this exact same error appears when im trying to stop the jail.

The error started after running this command iocage set jail_zfs=on nzbget without the quotes.

From what I can tell the dataset was not created when the jail was created.

This is the error
Code:
[root@nitroxygen ~]# iocage destroy nzbget																						
																																	
This will destroy jail nzbget																									
																																	
Are you sure? [y/N]: y																											
Stopping nzbget																													
Destroying nzbget																												
cannot open 'MainStorage/iocage/jails/nzbget/data': dataset does not exist														
Traceback (most recent call last):																								
  File "/usr/local/bin/iocage", line 10, in <module>																				
	sys.exit(cli())																												
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__												
	return self.main(*args, **kwargs)																							
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main													
	rv = self.invoke(ctx)																										
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke												
	return _process_result(sub_ctx.command.invoke(sub_ctx))																		
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke												
	return ctx.invoke(self.callback, **ctx.params)																				
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke												
	return callback(*args, **kwargs)																								
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/destroy.py", line 128, in cli											
	skip_jails=True).destroy_jail()																								
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 754, in destroy_jail									
	exit_on_error=self.exit_on_error).destroy_jail(path)																			
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_destroy.py", line 210, in destroy_jail								
	iocage.lib.ioc_stop.IOCStop(uuid, path, conf, silent=True)																	
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_stop.py", line 52, in __init__										
	self.__stop_jail__()																											
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_stop.py", line 165, in __stop_jail__								
	f"{self.pool}/{jdataset}"])																									
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_common.py", line 451, in checkoutput								
	out = su.check_output(*args, **kwargs)																						
  File "/usr/local/lib/python3.6/subprocess.py", line 336, in check_output														
	**kwargs).stdout																												
  File "/usr/local/lib/python3.6/subprocess.py", line 418, in run																
	output=stdout, stderr=stderr)																								
subprocess.CalledProcessError: Command '['zfs', 'list', '-H', '-r', '-o', 'name', '-S', 'name', 'MainStorage/iocage/jails/nzbget/dat
a']' returned non-zero exit status 1.


Also the command I used to create the jail was
Code:
iocage create -n nzbget boot=on ip4_addr="igb0|192.168.1.10/24 -r 11.1-RELEASE


The main thing I need help with is im looking to delete the jail. Can anyone help me please.

EDIT: I have confirmed that the 'MainStorage/iocage/jails/nzbget/data' was created and is located in the exact path.
 
Last edited by a moderator:

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,477
Is there a reason you are not creating jails from the new GUI? Does the jail you created on CLI show up in the new GUI? If it does, have you tried stopping it and deleting it from there?
 

itsryan

Dabbler
Joined
Jan 11, 2017
Messages
20
Is there a reason you are not creating jails from the new GUI? Does the jail you created on CLI show up in the new GUI? If it does, have you tried stopping it and deleting it from there?
I have been having problems creating jails in the new Gui since I don't know what settings need to be on.
I'm currently still testing the new jail system I have not moved my plugins over yet.
I have tried to remove the jail in the new Gui and yes it shows in their and when stop or delete is clicked nothing happens. I have also tried to stop the jail via shell with the error return in my main post.
I'm still not able to remove it. The only thing I have not tried is restarting the server, the thought being something is stuck somewhere.
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,477
I have been having problems creating jails in the new Gui since I don't know what settings need to be on.
I agree with you here. I have tried multiple times but it seems some key fields are not present yet in the GUI (which in all fairness is still in beta and has yet to claim to be feature parity with the old GUI).

I have tried to remove the jail in the new Gui and yes it shows in their and when stop or delete is clicked nothing happens. I have also tried to stop the jail via shell with the error return in my main post.
That's a bit strange. I have been playing with them like you (haven't moved any of my old warden jails over though) and haven't encountered the problem you describe.

Have you tried deleting the jail as reference in the manual? (see here)
 

Scentle5S

Explorer
Joined
Sep 9, 2016
Messages
74
Hello,

I'm having the exact same problem, except that I didn't create the jail by command line (I used the new GUI), and the error is slightly different (in fact, the jail can't be stopped) :
Code:
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
	sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
	return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
	rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
	return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
	return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
	return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/destroy.py", line 128, in cli
	skip_jails=True).destroy_jail()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 754, in destroy_jail
	exit_on_error=self.exit_on_error).destroy_jail(path)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_destroy.py", line 210, in destroy_jail
	iocage.lib.ioc_stop.IOCStop(uuid, path, conf, silent=True)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_stop.py", line 52, in __init__
	self.__stop_jail__()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_stop.py", line 142, in __stop_jail__
	stdout=f, stderr=su.PIPE)
  File "/usr/local/lib/python3.6/subprocess.py", line 291, in check_call
	raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['setfib', '0', 'jexec', 'ioc-test', '/bin/sh', '/etc/rc.shutdown']' returned non-zero exit status 1.

@itsryan : Did you manage to remove your jail ?

@nojohnny101 : I don't understand what you mean by "deleting the jail as reference in the manual" : the manual provides the same command that @itsryan said he used in his first message. Is there another way to delete the jail ?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@Scentle5S My brief use of iocage at the CLI in FreeNAS 11.1-U1 soon generated a "traceback error". Another way to delete a jail is to use a iocage clean, but it's the "nuclear option" as it zaps ALL iocage jails.
 

Scentle5S

Explorer
Joined
Sep 9, 2016
Messages
74
Thanks for the command, I didn't know about it. However that's quite drastic. I may use it later on, but for now I have two other iocage jails running just fine, that I need and don't have time to reconfigure for now. So that's going to be a last resort for me, and I'll wait and see if another solution can be found until then.
 

mrMuppet

Contributor
Joined
Mar 14, 2014
Messages
192
When I try to destroy my iocage jails I always have to do both: I have to destroy it via command line and than I have to delete in in the ui. After that it's always gone. Perhaps this helps.

Gesendet von meinem ONEPLUS A3003 mit Tapatalk
 

Scentle5S

Explorer
Joined
Sep 9, 2016
Messages
74
But that's the problem : none of these succeed. The command line returns the error I mentioned, and the GUI doesn't do anything.
 

Scentle5S

Explorer
Joined
Sep 9, 2016
Messages
74
I just tried it again today and was able to delete individual jails by command line (didn't try from the GUI though). Go figure...
 

geopfarth

Explorer
Joined
Apr 14, 2017
Messages
96
I was having a similar issue. I created an iocage jail and then tried to get rid of it. Mine showed up under the new GUI when created. The first time I clicked the delete button, the GUI gave me the "working" circle for a bit and then went back to the normal pointer. The jail was still visible in the GUI. I browsed away from the Jails tab and then back, highlighted the IOCAGE jail again and clicked delete a second time. This time the jail and all the folder paths were deleted and no longer showed up under the Jails or Storage tabs. I don't know why it took 2 tries to delete.
 

LotLits

Dabbler
Joined
Apr 10, 2015
Messages
30
So, I just ran into this from the command line. When destroying a jail, you ALWAYS have to run it twice otherwise it shows up in the jail list:

Code:
root@freenas:/mnt/tank # iocage destroy transmission

This will destroy jail transmission

Are you sure? [y/N]: y
Destroying transmission
root@freenas:/mnt/tank #
root@freenas:/mnt/tank # iocage destroy transmission
This will destroy jail transmission	

Are you sure? [y/N]: y
Partial UUID/NAME supplied, cannot check for dependant jails.

Proceed? [y/N]: y
Destroying transmission
root@freenas:/mnt/tank #


iocage destroy -rf <jail> also doesn't really work.
 

itsryan

Dabbler
Joined
Jan 11, 2017
Messages
20
@Scentle5S the way I used to destroy the jail was I did a full power down waited a few seconds then powered back on the server.
once it was up I used the terminal from local, I did not use it from the GUI.
Code:
iocage destroy nzbget

I don't know if the system needed a full power cycle or if it was because I ran the code from the local machine but it worked.

Also I found out why I had the problem in the first place.
When I ran the code I used igb0 instead of vnet0.
vnet is broken ISH according to iocage docs. I guess if you turn on vnet without using it, it will cause a problem.
 
Status
Not open for further replies.
Top