can't create a jail with some name

Keven

Contributor
Joined
Aug 10, 2016
Messages
114
hi,

i used to have a jail called unifi, but i deleted it many moons ago. now i want to re-create a jail with the same name, but i get an error saying that a jail with the same name already exist, which is not the case anymore.

here is the error message:
[EINVAL] uuid: A jail with name unifi already exists
Error: Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/middlewared/job.py", line 349, in run
await self.future
File "/usr/local/lib/python3.7/site-packages/middlewared/job.py", line 388, in __run_body
rv = await self.middleware.run_in_thread(self.method, *([self] + 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 718, in do_create
raise verrors
middlewared.service_exception.ValidationErrors: [EINVAL] uuid: A jail with name unifi already exists


also even if i delete a jail after i'm finished with it, it does not reuse the same JID. i'm not sure if it's link with my problem, but i would like to clean that up the right way so i can name my jail what i want.


Capture d'écran 2020-12-28 22.52.20.png

thanks keven
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I found that deleting the jail did not delete the directory (dataset) where the data for the jail was stored. Did you take a look at the storage location?
 

Keven

Contributor
Joined
Aug 10, 2016
Messages
114
I found that deleting the jail did not delete the directory (dataset) where the data for the jail was stored. Did you take a look at the storage location?

from here it does look each time i delete a jail the dataset is gone...

Capture d'écran 2020-12-29 12.51.21.png
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
You could try iocage rename unifi junk and rename the jail to junk. Then run iocage destroy junk to delete it. I had to do this dance with one of my jails recently to get rid of it completely.
 

Keven

Contributor
Joined
Aug 10, 2016
Messages
114
You could try iocage rename unifi junk and rename the jail to junk. Then run iocage destroy junk to delete it. I had to do this dance with one of my jails recently to get rid of it completely.



wtf
how it can show as "unificontroller in plugins and jails but, if i rename "unifi", it rename "unificontroller" to "junk"


Capture d'écran 2020-12-29 13.11.38.png
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
That's the problem I was having. I'd rename it back to what it was for now. Also I wouldn't be using the shell in the web interface for anything more than running a simple command. Use something like putty instead.

iocage list will show what jails you have.
 

Keven

Contributor
Joined
Aug 10, 2016
Messages
114
That's the problem I was having. I'd rename it back to what it was for now. Also I wouldn't be using the shell in the web interface for anything more than running a simple command. Use something like putty instead.

iocage list will show what jails you have.
just to be sure the command need to be:

iocage rename junk unifi

OR

iocage rename junk unificontroller


Code:
root@FREENAS:~ # iocage list
+-----+-----------------+-------+--------------+------+
| JID |      NAME       | STATE |   RELEASE    | IP4  |
+=====+=================+=======+==============+======+
| -   | junk            | down  | 11.3-RELEASE | DHCP |
+-----+-----------------+-------+--------------+------+
| 14  | plexmediaserver | up    | 11.3-RELEASE | DHCP |
+-----+-----------------+-------+--------------+------+
| 15  | transmission    | up    | 11.3-RELEASE | DHCP |
+-----+-----------------+-------+--------------+------+
root@FREENAS:~ #
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Correct. Either will work but if it were me I would name it back to what is was before (unificontroller).
 

cdiddy

Dabbler
Joined
Oct 3, 2017
Messages
39
@Keven did you ever solve this problem? I am having the same issue with plex - i used to run plex, and deleted it but now want to try again and it will not let me create jail named 'plex' - says jail already exists, but the dataset is long gone, 'jls' and 'iocage list' do not report there is any jail called plex... i know it must be something simple, because every thread i find with this issue dead-ends with no resolution after only a couple posts - and i find that typical of 'oh, duh!' solutions but i cannot figure this out for the life of me.
 

Keven

Contributor
Joined
Aug 10, 2016
Messages
114
@Keven did you ever solve this problem? I am having the same issue with plex - i used to run plex, and deleted it but now want to try again and it will not let me create jail named 'plex' - says jail already exists, but the dataset is long gone, 'jls' and 'iocage list' do not report there is any jail called plex... i know it must be something simple, because every thread i find with this issue dead-ends with no resolution after only a couple posts - and i find that typical of 'oh, duh!' solutions but i cannot figure this out for the life of me.
Yes it did worked, there was no "unifi" but unificontroller" and as @Jailer said jails can't start with the same name... It must be autocompleting by itself under the hood when just typing unifi. So what I did is I backup my config of unifi plugin then rename it to junk then make the jail unifi and then restoring from the backup in the jail. After making sure it was working properly I could delete the unifi plugin which the jail was named junk. I don't know if you could be running the plugin with another name than what the plugin is created for, but it wasn't my use case so I did not check it.

I hope it help you.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
not let me create jail named 'plex' - says jail already exists
zfs list -t all | grep plex and ls -l /mnt/<jail pool>/iocage, please
 

cdiddy

Dabbler
Joined
Oct 3, 2017
Messages
39
@Patrick M. Hausen - thank you but never mind. I updated from 11.3 to truenas core 12.0 and then tried again. It works now.
 
Top