Project

General

Profile

Bug #5766

Error "JailTemplate matching query does not exist." when trying to add a plugin.

Added by Anonymous about 6 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Nice to have
Assignee:
John Hixson
Category:
Middleware
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

I'm having a error when trying to install any plugin.
After the download step, the error below shows.

I remember tampering with the existing JailTemplates, erasing some useless (for me), maybe erasing or renaming the Plugin Template...

Is that reversible? Is it a common behavior of FreeNAS?

Request Method:     POST
Request URL:     https://192.168.0.2/plugins/plugin/install/a05689dde02074019687b024a2cd0fcad711f354b0c00646948378d329ed7728/
Software Version:     FreeNAS-9.2.1.6-RELEASE-x64 (ddd1e39)
Exception Type:     DoesNotExist
Exception Value:     

JailTemplate matching query does not exist.

Exception Location:     /usr/local/lib/python2.7/site-packages/django/db/models/query.py in get, line 307
Server time:     Tue, 12 Aug 2014 22:27:03 -0300

TRACEBACK

Environment:

Software Version: FreeNAS-9.2.1.6-RELEASE-x64 (ddd1e39)
Request Method: POST
Request URL: https://192.168.0.2/plugins/plugin/install/a05689dde02074019687b024a2cd0fcad711f354b0c00646948378d329ed7728/

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/plugins/views.py" in install_available
  254.         jail = new_default_plugin_jail(plugin.unixname)
File "/usr/local/www/freenasUI/../freenasUI/jails/utils.py" in new_default_plugin_jail
  595.     template = JailTemplate.objects.get(jt_name='pluginjail')
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/lib/python2.7/site-packages/django/db/models/query.py" in get
  307.                 self.model._meta.object_name)

Exception Type: DoesNotExist at /plugins/plugin/install/a05689dde02074019687b024a2cd0fcad711f354b0c00646948378d329ed7728/
Exception Value: JailTemplate matching query does not exist.

REQUEST INFORMATION

Request information
GET

No GET data
POST
Variable     Value
__form_id     u'form_str'
FILES

No FILES data
COOKIES
Variable     Value
csrftoken     'E0ebEBegRmuk0tWKhfZQomBv4NR0Q8VL'
sessionid     'q35o6lmy381h379rc4ikyszqzlgg3zlg'
fntreeSaveStateCookie     'root%2Croot%2F137%2F143%2F145%2Croot%2F137%2Croot%2F137%2F155%2Croot%2F137%2F155%2F157%2Croot%2F9%2F10%2Croot%2F94%2Croot%2F94%2F98'
META
Variable     Value
wsgi.multiprocess     False
HTTP_REFERER     'https://192.168.0.2/'
REDIRECT_STATUS     '200'
SERVER_SOFTWARE     'nginx/1.4.4'
SCRIPT_NAME     u''
HTTP_X_CSRFTOKEN     'E0ebEBegRmuk0tWKhfZQomBv4NR0Q8VL'
REQUEST_METHOD     'POST'
PATH_INFO     u'/plugins/plugin/install/a05689dde02074019687b024a2cd0fcad711f354b0c00646948378d329ed7728/'
SERVER_PROTOCOL     'HTTP/1.1'
QUERY_STRING     ''
CONTENT_LENGTH     '18'
HTTP_USER_AGENT     'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0'
HTTP_CONNECTION     'keep-alive'
HTTP_COOKIE     'csrftoken=E0ebEBegRmuk0tWKhfZQomBv4NR0Q8VL; sessionid=q35o6lmy381h379rc4ikyszqzlgg3zlg; fntreeSaveStateCookie=root%2Croot%2F137%2F143%2F145%2Croot%2F137%2Croot%2F137%2F155%2Croot%2F137%2F155%2F157%2Croot%2F9%2F10%2Croot%2F94%2Croot%2F94%2F98'
SERVER_NAME     'localhost'
REMOTE_PORT     '65281'
wsgi.url_scheme     'https'
SERVER_PORT     '443'
SERVER_ADDR     '192.168.0.2'
DOCUMENT_ROOT     '/usr/local/etc/nginx/html'
HTTP_PRAGMA     'no-cache'
HTTP_CONTENT_LENGTH     '18'
HTTP_X_REQUESTED_WITH     'XMLHttpRequest'
DOCUMENT_URI     '/plugins/plugin/install/a05689dde02074019687b024a2cd0fcad711f354b0c00646948378d329ed7728/'
wsgi.input     <flup.server.fcgi_base.InputStream object at 0x810f3b1d0>
HTTP_HOST     '192.168.0.2'
HTTPS     'on'
wsgi.multithread     True
HTTP_CACHE_CONTROL     'no-cache'
HTTP_CONTENT_TYPE     'application/x-www-form-urlencoded; charset=UTF-8'
REQUEST_URI     '/plugins/plugin/install/a05689dde02074019687b024a2cd0fcad711f354b0c00646948378d329ed7728/'
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 0x810e5ca90>
REMOTE_ADDR     '192.168.0.67'
HTTP_ACCEPT_LANGUAGE     'pt-br,en-us;q=0.5'
CONTENT_TYPE     'application/x-www-form-urlencoded; charset=UTF-8'
CSRF_COOKIE     u'E0ebEBegRmuk0tWKhfZQomBv4NR0Q8VL'
HTTP_ACCEPT_ENCODING     'gzip, deflate'

Associated revisions

Revision a543339f (diff)
Added by John Hixson about 6 years ago

Catch exceptions thrown when a template doesn't exist Ticket: #5766

History

#1 Updated by John Hixson about 6 years ago

  • Status changed from Unscreened to Screened

#2 Updated by Anonymous about 6 years ago

Any ideas? Will I have to reinstall the entire system from scratch?

#3 Updated by Anonymous about 6 years ago

I've managed to find the cause of the problem: the script that creates the new plugin jail searches for a template called pluginjail, if any char of this exact word is changed, the plugin installation fails. After renaming it back to pluginjail, everything worked.

I'm sure this shouldn't work that way.

Two suggestions:

1. Fix this hardcoding

What needs to be changed, in the "Are you sure you want to install 'XXXXX' plugin?" screen:

* Scan for available plugin jail templates
  - If the result is 0 (zero), then explain there should be at least one PluginJail Template installed before installing a plugin.
  - If the result is 1 ( one), then automatically chooses it for creating the plugin jail.
  - If the result is n ( > 1), then let users choose in a combobox which PluginJail Template to use.

* Instead of looking for 'pluginjail', use the chosen Template above to create the Plugin Jail

2. Block users trying to tamper/delete the only-possible PluginJail Template. In my case, I just renamed it and all the problem started.

#4 Updated by John Hixson about 6 years ago

  • Status changed from Screened to Resolved

You shouldn't delete templates ;-) Anyhow, "system" templates are now hidden and a543339f45845f8451140fa49096e28f598d6c7a will catch exceptions if the template doesn't exist and spit out an error message.

#5 Updated by Anonymous about 6 years ago

Thanks! :)

#6 Updated by Dru Lavigne almost 3 years ago

  • Target version set to Master - FreeNAS Nightlies

Also available in: Atom PDF