Can't stop, delete, or delete jail. Query returned multiple Jails.

Status
Not open for further replies.

noobnas

Dabbler
Joined
Aug 18, 2014
Messages
20
Hello all, I've gotten myself into a conundrum with a couple of jails. For context, I was experimenting with some simple web hosting in a Freenas jail. Since I was experimenting I created two jails to install Apache on. One a BSD standard jail, the other an Ubuntu 13.04 jail. When I was done experimenting I wanted to delete one of the jails. However, when I tried to delete one I received a very long error message. The contents of which I'll be pasting at the bottom of this post. What I THINK happened is my naming convention confused the jailing system. I named one jail just "apache" the other has a name to the effect of apache-web-redirect-bla-bla-bla I believe Freenas might think that I've created two jails with the same name based off of one of the main points from the error where is says "Query returned multiple jails."


Running the jls command from the CLI the apache jail shows up as jail ID #2 right now. The apache-web-redirect jail doesn't show at all. I have read through Cyberjocks guide, and remembered that if at all possible it is best to try to make changes via the GUI before the CLI, however since the GUI appears to have failed me I tried the command "sudo jail 2 -r" in an attempt to remove at least one of the jails. The command appears to complete successfully, however, they both still appeared after refreshing the GUI, so I restarted. They were still in the GUI. I navigated to the jails root directory to verify that both jails were still intact and they both appear to still have all the normal files within them. I repeated the command with "sudo jail apache -r" in the hopes that using a jail name would work instead of going by a jail ID that is being doubly used. However, I received the same results. I was running 9.2.1.6 at the time and decided to try and upgrade to 9.2.1.7 and repeat the two steps. I have not been able to remove the jail either via the GUI or via the command line since the upgrade either.


I am still able to create and delete other jails that I’ve made, but I can’t interact with these two. Clicking the jail settings, storage, stop or delete buttons in the jail tab of the web GUI all yield the same error below. It should also be noted that I can not manually shutdown the jail from the CLI with in the Jail. I am able to use the terminal button and give commands in the jail, but when I go to shut it down I also receive this error “/var/run/shutdown.pid: Unable to write pid file: No such file or directory”





This is not a major issue, more of an annoyance then anything, as it doesn’t seem to interfere with anything else. Please let me know if I’m missing any information. Thank you in advance!



-------------------------------------------------BEGIN ERROR MESSAGE---------------------------------------------













Request Method:


GET

Request URL:


http://10.1.1.252/jails/stop/18

Software Version:


FreeNAS-9.2.1.7-RELEASE-x64 (fdbe9a0)

Exception Type:


MultipleObjectsReturned

Exception Value:


Query returned multiple Jails

Exception Location:


/usr/local/www/freenasUI/../freenasUI/jails/queryset.py in get, line 149

Server time:


Mon, 18 Aug 2014 12:59:52 -0500

Traceback

Environment:



Software Version: FreeNAS-9.2.1.7-RELEASE-x64 (fdbe9a0)

Request Method: GET

Request URL: http://10.1.1.252/jails/stop/18





Traceback:

File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

107. response = middleware_method(request, callback, callback_args, callback_kwargs)

File "/usr/local/www/freenasUI/../freenasUI/freeadmin/middleware.py" in process_view

158. return login_required(view_func)(request, *view_args, **view_kwargs)

File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view

22. return view_func(request, *args, **kwargs)

File "/usr/local/www/freenasUI/../freenasUI/jails/views.py" in jail_stop

150. jail = models.Jails.objects.get(id=id)

File "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py" in get

151. return self.get_queryset().get(*args, **kwargs)

File "/usr/local/www/freenasUI/../freenasUI/jails/queryset.py" in get

149. "Query returned multiple Jails"



Exception Type: MultipleObjectsReturned at /jails/stop/18

Exception Value: Query returned multiple Jails







Request information
GET
No GET data

POST
No POST data

FILES
No FILES data

COOKIES
Variable


Value

csrftoken


'RO1n6eO5uBZf2h9DWVfU2KFmGAjqtMKN'

sessionid


'6h6zi2rcokq2wsl22w38pchpwhob5gjz'

fntreeSaveStateCookie


'root%2Croot%2F16%2Croot%2F16%2F17%2Croot%2F247%2Croot%2F251%2Croot%2F251%2F257%2Croot%2F251%2F257%2F259%2Croot%2F239%2Croot%2F239%2F274%2Croot%2F235'

META
Variable


Value

wsgi.multiprocess


False

HTTP_REFERER


'http://10.1.1.252/'

REDIRECT_STATUS


'200'

SERVER_SOFTWARE


'nginx/1.4.4'

SCRIPT_NAME


u''

REQUEST_METHOD


'GET'

PATH_INFO


u'/jails/stop/18'

SERVER_PROTOCOL


'HTTP/1.1'

QUERY_STRING


''

CONTENT_LENGTH


''

HTTP_USER_AGENT


'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0'

HTTP_CONNECTION


'keep-alive'

HTTP_COOKIE


'csrftoken=RO1n6eO5uBZf2h9DWVfU2KFmGAjqtMKN; sessionid=6h6zi2rcokq2wsl22w38pchpwhob5gjz; fntreeSaveStateCookie=root%2Croot%2F16%2Croot%2F16%2F17%2Croot%2F247%2Croot%2F251%2Croot%2F251%2F257%2Croot%2F251%2F257%2F259%2Croot%2F239%2Croot%2F239%2F274%2Croot%2F235'

SERVER_NAME


'localhost'

REMOTE_PORT


'60027'

wsgi.url_scheme


'http'

SERVER_PORT


'80'

SERVER_ADDR


'10.1.1.252'

DOCUMENT_ROOT


'/usr/local/etc/nginx/html'

HTTP_X_REQUESTED_WITH


'XMLHttpRequest'

DOCUMENT_URI


'/jails/stop/18'

wsgi.input


<flup.server.fcgi_base.InputStream object at 0x81161c0d0>

HTTP_HOST


'10.1.1.252'

wsgi.multithread


True

HTTP_CONTENT_TYPE


'application/x-www-form-urlencoded'

REQUEST_URI


'/jails/stop/18'

HTTP_ACCEPT


'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'

wsgi.version


(1, 0)

GATEWAY_INTERFACE


'CGI/1.1'

wsgi.run_once


False

wsgi.errors


<flup.server.fcgi_base.TeeOutputStream object at 0x81162b3d0>

REMOTE_ADDR


'192.168.10.2'

HTTP_ACCEPT_LANGUAGE


'en-US,en;q=0.5'

CONTENT_TYPE


'application/x-www-form-urlencoded'

CSRF_COOKIE


u'RO1n6eO5uBZf2h9DWVfU2KFmGAjqtMKN'

HTTP_ACCEPT_ENCODING


'gzip, deflate'
 

noobnas

Dabbler
Joined
Aug 18, 2014
Messages
20
Gosh, I'm sorry for leaving this out, one other thing did change since this started happening. I moved my local network the a 10.1.1.x subnet from a 192.168.0.x, but this was done AFTER I started receiving the error.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
noobnas, I would definitely put a ticket in at bugs.freenas.org. That seems like very broken behavior. ;)
 

noobnas

Dabbler
Joined
Aug 18, 2014
Messages
20
Thanks CyberJock I'll go ahead and put in a ticket when I get home later.
 

noobnas

Dabbler
Joined
Aug 18, 2014
Messages
20
Can't seem to get an activation email for the freenas bug ticketing system. Kind of aggravating. If I can get a bug in I'll post a link to it.
 

noobnas

Dabbler
Joined
Aug 18, 2014
Messages
20
OK so I can't seem to register this as a bug. For the life of me I can't get a verification email to make an account with Freenas' bug tracking site. I've discovered a new error. I can't stop my transmission jail. It just hangs at the shutdown window in the jails tab. It's only this one that's doing this. It's probably unrelated.
 

noobnas

Dabbler
Joined
Aug 18, 2014
Messages
20
Well, I never was able to verify my account for the bugging system but I found me own fix. Running the shell command "warden delete apache" allowed me to delete one of the jails from the list. I was then able to remove the other via the GUI and I am now happily back at my minimal jails list.

For anyone reading this in the future with the same or similar problem you could replace Apache with what ever jail name you're trying to remove. I believe you can also go by the Jail ID, which can by found by typing "jls" into the shell.
 

eboaz

Cadet
Joined
Feb 25, 2012
Messages
2
I encountered the same problem and I was able to validate my bug tracking account. This was filed as bug# 11549 last week, but it hasn't been screened yet. I've been at my wits end trying to fix this and will try tonight with the steps here.

Thanks!

-Eli

EDIT: I was able to remove the jails in question and make new ones! Thanks.
 
Last edited:
Status
Not open for further replies.
Top